Thursday, February 23, 2012

Centering Individual Cells in Tabular Environment

Sometimes it looks good to center the header of a table, but not the content.
I used to use minipage to do this, but using multicolumn seems to work better

\begin{table}
\centering
\begin{tabular}{rlr||rlr}\hline
\multicolumn{1}{c}{Number} & \multicolumn{1}{c}{Return Name} & \multicolumn{1}{c||}{Degree}
& \multicolumn{1}{c}{Number} & \multicolumn{1}{c}{Return Name} & \multicolumn{1}{c}{Degree}\\
\hline
17 & Russell 3000 & 9 & 17 & Russell 3000 & 14 \\
19 & MSCI EAFE & 9 & 19 & MSCI EAFE & 12 \\
20 & MSCI EM & 6 & 4 & CombinedEnergy DS SC1 & 9 \\
3 & Growth DS & 5 & 20 & MSCI EM & 9 \\
25 & Bacrclay's HY SC3 & 5 & 7 & HF1 Distressed DS & 8 \\
4 & CombinedEnergy DS SC1 & 4 & 25 & Bacrclay's HY SC3 & 7 \\
2 & Ventures DS & 3 & 1 & Buyouts DS SC1 & 6 \\
\hline
\end{tabular}
\end{table}

No comments:

Post a Comment