I'm pretty new to LaTeX and I've been trying to figure out a way to create a table where my table headers are centered but the rest of the table is not. I tried using the {\centering Blarg} commands, but they didn't work. Here is a minimal working example:
Code: Select all
Code, edit and compile here:
\documentclass [12pt,letterpaper]{report}\begin {document}\begin{table}\begin{center}\begin{tabular}{|p{45mm} p{45mm} p{45mm}|}\hline\begingroup\centering Header 1\endgroup & \begingroup\centering Header 2\endgroup & \begingroup\centering Header 3\endgroup \\Some random text here to fill the box & Some random text here to fill the box & Some random text here to fill the box \\\hline\end{tabular}\end{center}\end{table}\end{document}
However, as many other forum posts have informed me, this leaves some vertical white space around the headers. Is there a way to center only the headers without using the center environment? Or is there a way to limit the white space from the center environment?
Thanks!
-Tarun