I have the table below with, \multirow
, \multicolumn
and \textsuperscript
calls. I would like to have all entries centered, and the numerical entries additionally "scientifically" aligned right (as done by the siunitx
package). For the time being I use \rlap
, but that only aligns the text superscripts, not the numerical entries. Ideally, I should use something like the siunitx
package, and in principle it should automatically align the textsuperscripts, but I am having trouble combining the siunitx
package with my current code. Can anyone help?
\begin{center}
\renewcommand{\arraystretch}{1.5}
\begin{tiny}
\begin{longtable}{ccc}
\caption{...}\label{tab:1}\\
\hline
Text & Text & $X$\\
& & $\mathrm{\left[\%\right]}$\\
\hline
\endfirsthead
\multicolumn{3}{l}%
{\tablename\ \thetable\ (\emph{continued from previous page})} \\
\hline
Text & Text & $X$\\
& & $\mathrm{\left[\%\right]}$\\
\hline
\endhead
\hline
\multicolumn{3}{r}%
{(\emph{continued on next page})} \\
\endfoot
\hline
\\
\multicolumn{3}{l}%
{\shortstack[l]{\textsuperscript{a}Method 1\\
\textsuperscript{b}Remark}}
\endlastfoot
Text & Text & 70.5\rlap{\textsuperscript{a}}\\
& Text & 8.8\rlap{\textsuperscript{a}}\\
& Text & 78.1\rlap{\textsuperscript{a}}\\
& Text & 7.0\rlap{\textsuperscript{a}}\\
& Text & 76.5\rlap{\textsuperscript{a}}\\
& Text & 92.5\rlap{\textsuperscript{a,b}}\\
Text & \multirow{2}{*}{text} & \multirow{2}{*}{8.71\rlap{\textsuperscript{a}}}\\
Text & &\\
Text & Text & 79.2\rlap{\textsuperscript{a}}\\
& Text & 69.0\rlap{\textsuperscript{a}}\\
& Text & 65.2\rlap{\textsuperscript{a}}\\
& Text & 77.7\rlap{\textsuperscript{a}}\\
& Text & 69.7\rlap{\textsuperscript{a,b}}\\
& Text & 67.6\rlap{\textsuperscript{a}}\\
& &\\
\cdashline{1-3}
\multicolumn{2}{c}%
{\textbf{Mean}} & 76.35\\
\multicolumn{2}{c}%
{(SD)} & (7.82)\\
\end{longtable}
\end{tiny}
\end{center}
Here the shortened MWE combining \multirow
with \tablenum
, to achieve the same alignment, but with larger space between the two rows than with \makecell
:
\documentclass{article}
\usepackage{longtable}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{arydshln}
\usepackage{makecell}
\usepackage{multirow}
\begin{document}
\renewcommand{\arraystretch}{1.5}
\begin{longtable}{ccc}
\caption{...}\label{tab:1}\\
\hline
Text & Text & $X$\\
& & [\%]\\
\hline
\endfirsthead
\multicolumn{3}{l}{\tablename\ \thetable\ (\emph{continued from previous page})} \\
\hline
Text & Text & $X$\\
& & [\%]\\
\hline
\endhead
\hline
\multicolumn{3}{r}{(\emph{continued on next page})} \\
\endfoot
\hline
\multicolumn{3}{l}%
{\shortstack[l]{\textsuperscript{a}Method 1\\
\textsuperscript{b}Remark 1}}
\endlastfoot
\multirow{ 1}{*}{Ttext} & \multirow{ 1}{*}{Ttext} & \multirow{ 1}{*}{\tablenum[table-format = 2.1]{70.5}\rlap{\textsuperscript{a,b}}}\\
Ttext & \multirow{ 2}{*}{Ttext} & \multirow{ 2}{*}{\tablenum[table-format = 2.1]{8.7}\rlap{\textsuperscript{a}}}\\
Ttext & &\\
\cdashline{1-3}
\multicolumn{2}{c}{\textbf{Mean}} & \multirow{ 1}{*}{\tablenum[table-format = 2.1]{76.3}}\\
\multicolumn{2}{c}{(SD)} & \multirow{ 1}{*}{\tablenum[table-format = 2.1,input-symbols=()]{(7.8)}}\\
\end{longtable}
\end{document}
\shortstack
comes from. Also why are you using left/right like that? Not needed at all.