Below is the table that I am trying to diagnose:
\documentclass{article}
\usepackage{array, makecell}
\begin{document}
\begin{table*}
\begin{tabular}{@{} >{\centering} m{1.67cm}| >{\centering} m{0.7cm}
>{\centering} m{0.7cm} >{\centering} m{0.7cm} >{\centering} m{0.7cm}
>{\centering} m{0.7cm} >{\centering} m{0.7cm} >{\centering} m{0.7cm}
>{\centering} m{0.7cm} @{}}
Test & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ \newline $8$ \newline $9$ & $8$ \\
\hline
\hline
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
1 & 0 & 0 & 0 & 0 & 0 & 0& 0 & 1 \\
\hline
1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 \\
\hline
\end{tabular}
\end{table*}
\end{document}
If I try to compile this, it gives several Extra alignment tab has been changed to \cr
errors and the entire table is a mess. However, if I just remove the final >{\centering}
from the last column, everything looks fine. How can I include the centering and have the table show up fine? The @{}
included in the tabular brackets came from a suggestion in this question, which didn't end up solving the problem.
As an additional side-question, if I change the document class from article
to revtex4-1
, the rows with entries that have newlines (the first row) is no longer vertically centered. Does anyone know what's up with that, and how to get vertical centering in tables with revtex?
\newline
commands for?