I have tried to center text within a cell in my table by defining a new column type = \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
Yet in my MWE, my contents are still not centering
MWE:
\documentclass{article}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}
\newcounter{vonecount}
\setcounter{vonecount}{0}
\newcommand{\vone}{\stepcounter{vonecount}\thevonecount}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\begin{document}
\begin{tabular}{r|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}}
\cline{1-18}
\multicolumn{1}{|r|}{Section One} &
\multicolumn{17}{>{\centering}p{4in}|}{Part One - Synonyms} \\
\cline{1-18}
Question \# &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone \\
\cline{2-18}
Correct Answer &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A \\
Your Answer & & & & & & & & & & & & & & & & & & \\
\cline{1-18}
\multicolumn{1}{|r|}{Section One} &
\multicolumn{17}{>{\centering}p{4in}|}{Part Two - Sentence Completions} \\
\cline{1-18}
Question \# &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone &
\vone \\
\cline{2-18}
Correct Answer &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A &
A \\
Your Answer & & & & & & & & & & & & & & & & & & \\
\hline
\multirow{2}{*}{Scores} &
\multicolumn{4}{c|}{Correct} &
\multicolumn{4}{c|}{Total} &
\multicolumn{4}{c|}{Stanine} &
\multicolumn{5}{c|}{Percentile Rank} \\
\cline{2-18}
&
\multicolumn{4}{c|}{} &
\multicolumn{4}{c|}{} &
\multicolumn{4}{c|}{} &
\multicolumn{5}{c|}{} \\
\cline{2-18}
\end{tabular}
\end{document}
\multicolumn{17}{c}{Part One - Synonyms}
for the header cell?c
in this case?c
does work, and fixes the problem. But the table is then too wide, past the textwidth. Would the solution be to change the environment type? I have switched it to 2.9mm (which keeps it within the text block), but there is still a slight discrepancy in center spacing in the double-digit numbers.