I want to center a table caption between the 5th and 6th columns, like this:
where I've made the following
in this way:
% for table captions on top
\usepackage[tableposition=top]{caption}
% space out columns
\setlength{\tabcolsep}{14pt}
% remove default caption numbering
\usepackage{caption}
\begin{table}[th!]
\centering
\caption*{$x_{2}$}
\begin{tabular}{l c | c c c c c}
& & 0 & 1 & 2 & 3 \\
\hline
& 0 & .08 & .07 & .04 & .00 \\
& 1 & .06 & .15 & .05 & .04 \\
$x_{1}$ & 2 & .05 & .04 & .10 & .06 \\
& 3 & .00 & .03 & .04 & .07 \\
& 4 & .00 & .01 & .05 & .06
\end{tabular}
\end{table}
where the h!
is just for forcing the table's position in the document.
I've looked into threeparttable
, but I didn't see anything in the (fairly brief) documentation that seemed like it would help.
Is there an easy way to do this?
\ & \ & \ & \multicolumn{2}{c}{$x_2$} & \ & \\
above your data. It worked when I tried it in your code.\multicolumn{}{}{}
merges columns in your table, 2 in this case. I hope this helps. – nikjohn Apr 10 '17 at 23:46