Ich möchte meine Tabelle auf die Textbreite bringen. Das hat auch gut geklappt. Allerdings ist sollen bis auf die erste Spalte alle Spalten die gleiche Breite haben.

Ich habe es wie folgt probiert:

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\begin{document}
\begin{table}[htb]
\caption{Eine Tabelle}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}*1l r r r r r r} \hline
& & & \multicolumn{4}{c}{Kategorie}\\ \cline{4-7}
& \multicolumn{2}{c}{Gesamt}&\multicolumn{2}{c}{Subkategorie}&\multicolumn{2}{c}{Subkategorie}\\
&\multicolumn{2}{c}{Text}& \multicolumn{2}{c}{Text}&\multicolumn{2}{c}{Text}\\ \hline
Ein längeres Wort oder zwei& xx.xx & y.yy & xx.xx & y.yy & xx.xx & y.yy \\
Ein anderes Wort& xx.xx & y.yy & xx.xx & y.yy & xx.xx & y.yy \\
\end{tabular*}
\end{table}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

gefragt 27 Feb '18, 20:24

J_tex's gravatar image

J_tex
16751115
Akzeptiert-Rate: 0%

bearbeitet 27 Feb '18, 21:42

cis's gravatar image

cis
9.5k96460491

Off-Topic: Für tabular* braucht man übrigens kein tabularx.

(28 Feb '18, 15:02) gast3

Verwende tabularx. Aus der Anleitung:

A new environment, tabularx, is defined, which takes the same arguments as tabular*, but modifies the widths of certain columns, rather than the inter column space, to set a table with the requested total width. The columns that may stretch are marked with the new token X in the preamble argument.

Außerdem:

Normally all X columns in a single table are set to the same width, [...]

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\begin{document}
\begin{table}[htb]
\caption{Eine Tabelle}
\begin{tabularx}{\linewidth}{@{\extracolsep{\fill}}*1l X X X X X X} \hline
& & & \multicolumn{4}{c}{Kategorie} \\
\cline{4-7}
& \multicolumn{2}{c}{Gesamt} & \multicolumn{2}{c}{Subkategorie} & \multicolumn{2}{c}{Subkategorie} \\
& \multicolumn{2}{c}{Text} & \multicolumn{2}{c}{Text} & \multicolumn{2}{c}{Text} \\
\hline
Ein längeres Wort oder zwei & xx.xx & y.yy & xx.xx & y.yy & xx.xx & y.yy \\
Ein anderes Wort & xx.xx & y.yy & xx.xx & y.yy & xx.xx & y.yy \\
\end{tabularx}
\end{table}
\end{document}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

alt text

Permanenter link

beantwortet 27 Feb '18, 22:09

Henri's gravatar image

Henri
15.7k133943
Akzeptiert-Rate: 46%

bearbeitet 27 Feb '18, 22:09

Ja. Das sieht so ganz gut aus. Allerdings sind die sechs rechten Spalten nun linksbündig. Ich wollte sie rechtsbündig haben. Das erreicht man mit:

Öffne in Overleaf
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\begin{document}
\begin{table}[htb]
\caption{Eine Tabelle}
\begin{tabularx}{\linewidth}{@{\extracolsep{\fill}}*1l R R R R R R} \hline
&&& \multicolumn{4}{c}{Kategorie}\\ \cline{4-7}
& \multicolumn{2}{c}{Gesamt} & \multicolumn{2}{c}{Subkategorie} & \multicolumn{2}{c}{Subkategorie} \\
& \multicolumn{2}{c}{Text} & \multicolumn{2}{c}{Text} & \multicolumn{2}{c}{Text} \\ \hline
Ein längeres Wort oder zwei & xx.xx & y.yy & xx.xx & yy.yy & xx.xx & y.yy \\
Ein anderes Wort & xx.xx & yy.yy & xx.xx & y.yy & xx.xx & yy.yy\\
\end{tabularx}
\end{table}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Permanenter link

beantwortet 28 Feb '18, 13:53

J_tex's gravatar image

J_tex
16751115
Akzeptiert-Rate: 0%

bearbeitet 28 Feb '18, 15:01

gast3's gravatar image

gast3
(ausgesetzt)

Deine Antwort
[Vorschau ausblenden]

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Frage-Themen:

×257
×32
×17

gestellte Frage: 27 Feb '18, 20:24

Frage wurde gesehen: 10,860 Mal

zuletzt geändert: 28 Feb '18, 15:02

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×