Community,
I want to increase the width of a column because the text in the second row makes a new line. When I use p{x.xcm} there is no more centering of the content below.
Here is my code:
\begin{tabularx}{\textwidth}{
l
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering}X
>{\centering\arraybackslash}X
}
\toprule
\multicolumn{1}{c}{\multirow{2}{*}[-0.5ex]{Probe}} & \multicolumn{2}{c}{Brechungsindex} &
\multicolumn{3}{c}{Volumen/mL} & \multicolumn{3}{c}{Masse/g} & \multicolumn{3}{c}{Stoffmenge/mol}
& \multicolumn{3}{c}{vol\%} & \multicolumn{3}{c}{mol\%}\\
\cmidrule{2-18}
& A-reich & B-reich & A & B & C & A & B & C & A & B & C & A & B & C & A & B & C\\
\midrule
P1 & 1.4242 & 1.4242 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42
& 42 & 42 & 42\\
P3 & 1.4242 & 1.4242 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42 & 42
& 42 & 42 & 42\\
\bottomrule
\end{tabularx}
The table is also in a sideways environment because it is so large.
Thank you in advance.
Greetings FH
>{\centering}
with twoc
tabularx
totabular
ortabular*
if you want to make sure yor table is as wide as the current linewidth. Additionally, I would suggest usingsiunitx
for the units and in order to align the numbers in the table columns.\cmidrule{2-18}
with\cmidrule(r){2-3} \cmidrule(lr){4-6} \cmidrule(lr){7-9} \cmidrule(lr){10-12} \cmidrule(lr){13-15} \cmidrule(l){16-18}