It's never ending story about that -> previous post. Simply, I just want to align to 'pm' sign my number columns. I've already tried replacing headers {l | l *{2}{>{\centering\arraybackslash}X}}
with {l | l l l *{2}{>{\centering\arraybackslash}X}
and than to check one column with siunitx: {l | l S[table-align-uncertainty, separate-uncertainty=true] l l *{2}{>{\centering\arraybackslash}X}
but it doesn't work at all.
MWE:
\documentclass{article}
\usepackage{float, enumitem, amsmath}
\usepackage{rotating}
\usepackage{booktabs, makecell, multirow, tabularx, threeparttable}
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\usepackage{colortbl, color} %I preffer that instead of xcolor because xcolor give me errors with beamer
\usepackage{caption}
\captionsetup{belowskip=-5pt}
\captionsetup[table]{justification=raggedright,singlelinecheck=off}
\begin{document}
\begin{table}
\centering
\settowidth\rotheadsize{\theadfont Description 3 }
\renewcommand\arraystretch{1.1}
\caption{Simple caption.}
\label{tab:setTag}
\begin{tabularx}{\linewidth}{l | l *{2}{>{\centering\arraybackslash}X}}
\Xhline{1pt}
& \thead[l]{Results}
& \thead{Method 1} & \thead{Method 2} \\
\Xhline{0.7pt}
& & \multicolumn{2}{c}{First section} \\
\Xcline{3-4}{0.6pt}
\multirow{3}{*}{\rothead{Description 1}}
&Very long name & $11,5 \pm 0,5$ & $444,34 \pm 71,9$ \\
& Very long name & $109,2 \pm 75,3$ & $2,8 \pm 664,36$ \\
& Very long name& $9438 \pm 8$ & $256,0 \pm 98,1$ \\
& Very long name & $11,5 \pm 0,5$ & $444,34 \pm 71,9$ \\
& Very long name & $109,2 \pm 75,3$ & $2,8 \pm 664,36$ \\
& Very long name & $9438 \pm 8$ & $256,0 \pm 98,1$ \\
\end{tabularx}
\end{table}
\end{document}
I've changed header to \begin{tabularx}{\linewidth}{l | X S[table-align-uncertainty, separate-uncertainty=true] S[table-align-uncertainty, separate-uncertainty=true]*{2}{>{\centering\arraybackslash}}}
and data from first row to 11,5(5) & 444,34(719
and I get that result (strange Methods headers):
I've now had errors with array package '>{}' at wrong position. Can someone please tell me which one is the correct one? And another one with 'missing # inserted in alignment preamble' and the third one 'missing $ inserted' but I don't know why because it shows line with \end{tabularx}
.
New part of the code:
\begin{tabularx}{\linewidth}{l | X S[table-align-uncertainty, separate-uncertainty=true] S[table-align-uncertainty, separate-uncertainty=true]*{2}{>{\centering\arraybackslash}}}
\Xhline{1pt}
& \thead[l]{Results}
& {\thead{Method 1}} & {\thead{Method 2}} \\
\Xhline{0.7pt}
& & \multicolumn{2}{c}{First section} \\
\Xcline{3-4}{0.6pt}
\multirow{3}{*}{\rothead{Description 1}}
&Very long name & $11,5(5)$ & $444,34(719)$ \\
& Very long name & $109,2(753)$ & $2,8(63)$ \\
& Very long name& $9438(8)$ & $256,0(981)$ \\
&Very long name & $11,5(5)$ & $444,34(719)$ \\
& Very long name & $109,2(753)$ & $2,8(63)$ \\
& Very long name& $9438(8)$ & $256,0(981)$ \\
\end{tabularx}
It shows (which is obviously not align):
S
type columns of the table, you should use11,5(5)
as the input in theS
type column.tabularx
here? Your table is already narrow enough to fit into the textwidth. By usingtabularx
here you only stretch the table introducing unneccessary white space.