Reduce cell margins in a table
To change the amount of vertical whitespace that LaTeX inserts to the left and right of every column, change the length parameter \tabcolsep
. Its default value is 6pt
; change it via either \setlength
or \addtolength
. In the example below, the second table features a value of 1.5pt
for \tabcolsep
.
\documentclass{article}
\usepackage{graphicx}
\newcommand*\rot[1]{\rotatebox{90}{#1}}
\begin{document}
\begin{table}[!ht]
\centering
\begin{tabular}{| c | c | c |}
\hline
1 & 2 & 3\\ \hline
\rot{\textbf{1st column}} & \rot{\textbf{2nd column\ }} & \rot{\textbf{3rd column}} \\ \hline
\end{tabular}
\qquad % get some separation between the two tabulars
\setlength\tabcolsep{1.5pt} % default value: 6pt
\begin{tabular}{| c | c | c |}
\hline
1 & 2 & 3\\ \hline
\rot{\textbf{1st column}} & \rot{\textbf{2nd column\ }} & \rot{\textbf{3rd column}} \\ \hline
\end{tabular}
\end{table}
\end{document}
Is this what you looking for?
\documentclass{article}
\usepackage{graphicx}
\newcommand*\rot{\rotatebox{90}}
\begin{document}
\begin{table}[!ht]
\centering
\begin{tabular}{|@{\hskip3pt}c@{\hskip3pt}| c |@{\hskip3pt}c@{\hskip3pt}|}
\hline
1 & 2 & 3\\ \hline
\rot{\textbf{1st column}} & \rot{\textbf{2nd column}} & \rot{\textbf{3rd column}} \\ \hline
\end{tabular}
\end{table}
\end{document}
The @{}
in place of insertion set \tabcolsep
distance to zero. If you like to have in this place different space between adjacent columns, than you can locally determine it with @{<distance>}
where you select <width>
according to your wish.