1

I simply want to align the decimal points in columns. I know this has been answered already but I can not figure out how to apply it in my table. Forgive me, I am very new to LaTeX. This is the code that I have:

\begin{table}[h]
\begin{center}
\begin{tabular}{ccc|cc|cc|c}
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&$D$&$E$&$D$&$E$&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\end{tabular}
\end{center}
\end{table}

One more thing. If my table was too long, and I wanted to cut it so that the other half is in the other page, is that possible? And if it is not too much to ask, can you show me how?

Ian
  • 11
  • 1

1 Answers1

1

For the aligning see the duplicated bug in the first comment. For page breaking you can use longtable environment from the longtable package. See its documentation for more details. I converted your example to longtable and siunitx (for the aliging) and made it longer to show the page breaking:

\documentclass{article}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{siunitx}
\begin{document}
\begin{longtable}[c]{ccc|SS|SS|S}
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\hline\hline 
\multirow{2}{*}{$A$}  & \multirow{2}{*}{$B$}  & \multirow{2}{*}{$C$} & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & 
\multirow{2}{*}{$F$}\\\cline{4-7}
&&&{$D$}&{$E$}&{$D$}&{$E$}&\\\hline\hline
\multirow{3}{*}{2} &    \multirow{3}{*}{5} &    12  &   2.146   &   9.144   &   6.311   &   9.566   &   7.134   \\  \cline{3-8}
&&  14  &   3.245   &   10.255  &   6.978   &   19.274  &   18.245  \\  \cline{3-8}
&&  16  &   7.176   &   11.968  &   10.852  &   47.485  &   25.282  \\  \hline\hline
\end{longtable}

\end{document}
Toscho
  • 4,713
  • Are the longtable and siunitx packages already in LaTeX or do I have to dowmload and install something else? I'm afraid, the code didn't work. – Ian Mar 09 '13 at 12:55
  • longtable and siunitx are packages, as you said yourself. That means, they're not part of the LaTeX kernel. You'll have to load them via \usepackage{siunitx} and \usepackage{longtable}, just as you did with \multirow.

    If your question aims at tex-distributions, I'm not sure. Both are available in TeXlive and probably MiKTeX but possibly not in their minimal configurations.

    – Toscho Mar 09 '13 at 15:05