# Line break in table and multicolumn layout problem

I have a small problem. I would like to rebuild the following table:

Until now I made the following code:

\begin{tabular}{lllllll}\toprule
\textbf{Factor} & \textbf{Effect} & \textbf{Percentage of Variation} & \textbf{Confidence Intervall} & \textbf{Effect} & \textbf{Percentage of Variation} & \textbf{Confidence Intervall} \\ \midrule

I & 26.55 & ~ & (16.35,36,74) & 0.03 & ~ & (-0.02,0.07) \\

\bottomrule
\end{tabular}

My problem now is the following:

• I cannot get "Percentage of Variation" etc. on two lines (line break).

• I don't know how to make the "Additive Model" und "Multiplicative Model".

I would really appreciate if somebody could help.

Here is a quick view on using booktabs for the layout, and makecell for per-cell alignment:

\documentclass{article}
\usepackage{booktabs,makecell}
\begin{document}
\begin{tabular}{lrcrrcr}
\toprule
& \multicolumn{3}{c}{\bfseries Additive Model} & \multicolumn{3}{c}{\bfseries Multiplicative Model} \\
\cmidrule(lr){2-4}\cmidrule(lr){5-7}
\textbf{Factor} & Effect & \makecell[cb]{Percentage \\ of Variation} & \makecell[cb]{Confidence \\ Interval} &
Effect & \makecell[cb]{Percentage \\ of Variation} & \makecell[cb]{Confidence \\ Interval} \\
\midrule
I   &  $26.55$ &      ~ & $( 16.35, 36.74)$ & $0.03$ &      ~ & $(-0.02, 0.07)$\rlap{\textsuperscript{a}} \\
A   & $-26.04$ & $30.1$ & $(-36.23,-15.84)$ & $-0.97$ & $49.9$ & $(-1.02,-0.93)$ \\
B   & $-26.04$ & $30.1$ & $(-36.23,-15.84)$ & $-0.97$ & $49.9$ & $(-1.02,-0.93)$ \\
AB  & $25.54$ & $29.0$ & $( 15.35, 35.74)$ & $0.03$ & $\phantom{0}0.0$ & $(-0.02, 0.07)$\rlap{\textsuperscript{a}} \\
$e$ &        ~ & $10.8$ &                 ~ &       ~ & $\phantom{0}0.2$ &               ~ \\
\bottomrule
\end{tabular}
\end{document}

For small tables, manual \phantom adjustments are easy to make. Alternatively, one could consider siunitx column specifications.

\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\begin{tabular}[b]{@{}c@{}}
#1
\end{tabular}%
}
\begin{document}
\begin{table}
\begin{tabular}{*{7}{c}}\toprule
& \multicolumn{3}{c}{Additive model} & \multicolumn{3}{c}{Multiplicative model}\\\cmidrule(lr){2-4}\cmidrule(lr){5-7}

I & 26.55 & ~ & (16.35,36,74) & 0.03 & ~ & (-0.02,0.07) \\

\bottomrule
\end{tabular}
\end{table}
\end{document}

Another solution, also using makecell, siunitx, caption and threeparttable:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs,  caption}
\def\cmidrulewidth{\lightrulewidth}
\captionsetup{font = bf, labelfont =sc, labelsep = quad}
\usepackage{siunitx}
\sisetup{table-format=2.1}
\usepackage{makecell}
\usepackage{threeparttable}

\begin{document}

\begin{table}
\centering
\begin{threeparttable}
\caption{Percentage of Variation Explained by the Two Models}
\begin{tabular}{ >{\boldmath}cS[table-format=-2.2]SccS[table-format=-1.2]Sc}
\toprule
\cmidrule(lr){2-4}\cmidrule(lr){6-8}
$I$ & 26.55 & ~ &$(16.35,36.74)$ & &  0.03 & ~ & $(-0.02,0.07)$ \\
$A$  & -26.04 & 30.1 & $(-36.23,-15.84)$ & &  -0.97 & 49.9 & $(-1.02,-0.93)$ \\
$B$  & -26.04 & 30.1 & $(-36.23,-15.84)$ & &  -0.97 & 49.9 & $(-1.02,-0.93)$ \\
$AB$  &  25.54 & 29.0 & $(15.35, 35.74)$ & &   0.03 & 0.0 & $(-0.02, 0.07)$\rlap{\tnote{a}} \\
$e$ &        ~ & 10.8 &                 ~ &       ~ & &  0.2 &               ~ \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a]Not significant.
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}