my table right now looks like this:
I want to center-align the text in the first two columns like how it is done with the other columns (sorry for the quick and dirty photoshop job):
I noticed that when I add vertical divider after the first and second column that the second column is much wider than the first column. To me that seems weird because the text in the columns is the same and also the Alignment.
My LaTex:
\documentclass{article}
\usepackage{booktabs}
\usepackage{makecell}
\begin{document}
\begin{table}
\renewcommand{\arraystretch}{1.2}
\centering
\begin{tabular}{@{}ccccccc@{}}
\toprule
\multicolumn{2}{r}{Long Word} & \phantom{a} & \multicolumn{4}{c}{Another Word} \\\cmidrule{1-2}\cmidrule{4-7}
\makecell[c]{\\a} & \makecell[c]{\\a} & & \makecell[c]{word\\a} & \makecell[c]{word\\a} & \makecell[c]{word\\a} & \makecell[c]{word\\ a} \\
\midrule
a & a & & a & a & a & a \\
a & a & & a & a & a & a \\
a & a & & a & a & a & a \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Why aren't the two cells under "Long Word" together as wide as the "Long Word" cell? How can I achieve this?
Thanks for help!
Best Answer