I have a table as shown below.
\documentclass{article}
\usepackage{graphicx}
\newcommand*\rot{\rotatebox{90}}
\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}
\end{table}
\end{document}
I would like the width of columns by reducing the padding. I have tried
\begin{tabular}{| p{0.1cm} | c | c |}
However, it only removes the white space in the right-hand side of the first column and leave the white space intact in the left-hand side of it.
Best Answer
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 is6pt
; change it via either\setlength
or\addtolength
. In the example below, the second table features a value of1.5pt
for\tabcolsep
.