How can I reduce the spacing between columns in a table?

There are other similar questions, all with different answers, but I could not find one which achieves what I want. In the table below, the spacing between the numbers is too wide. How can I shrink it a bit?

\newcommand[2] < \begin \textbf \\ \textbf \end > \begin[ht] \begin \cline & \multicolumn> & \multicolumn> \\ \cline & \testmode & \testmode & \testmode & \testmode & \testmode & \testmode \\ \hline \multicolumn<|c|> > & 209.86 & 370.18 & 411.25 & 180.85 & 245.37 & 262.61 \\ \multicolumn<|c|> > & 213.28 & 363.35 & 476.10 & 209.04 & 247.02 & 208.63 \\ \hline \end \caption \label \end
65.2k 15 15 gold badges 103 103 silver badges 306 306 bronze badges asked Jun 30, 2017 at 5:59 353 1 1 gold badge 4 4 silver badges 10 10 bronze badges

You can adjust \tabcolsep or write something like @ <\hskip.05cm>between the column definitions. But to really help you it would be greatly appreciated to see a MWE.

Commented Jun 30, 2017 at 6:01

Please always add a minimal but working example (MWE) instead of only a code snippet. A compilable examples makes it easier to reproduce your problem without need for any speculation about additional needed or related code. So please help us to help you.

Commented Jun 30, 2017 at 6:13

@TeXnician and @Jürgen: I think, the main problem is doubling \tabcolsep with the inner tabular (see my answer) and therefore no need to reduce the column separation of the outer tabular .

Commented Jun 30, 2017 at 6:27

4 Answers 4

In your example you have doubled the column separation using a tabular inside a tabular . Note: LaTeX adds a distance of \tabcolsep before and after each column. In your case you have such a distance before and after the column of the inner tabular of \testmode and before and after the column of the outer tabular. To avoid this, you should add @<> before the first column of the inner tabular and after the last column of the inner tabular:

\documentclass \begin \newcommand[2] c@<>>% Avoid doubling \tabcolsep \textbf \\ \textbf \end% > \begin[ht] \begin \cline & \multicolumn> & \multicolumn> \\ \cline & \testmode & \testmode & \testmode & \testmode & \testmode & \testmode \\ \hline \multicolumn<|c|> > & 209.86 & 370.18 & 411.25 & 180.85 & 245.37 & 262.61 \\ \multicolumn<|c|> > & 213.28 & 363.35 & 476.10 & 209.04 & 247.02 & 208.63 \\ \hline \end \caption \label \end \end

enter image description here

To explain some more: By default LaTeX adds \hskip\tabcolsep before it starts a column and after it has finished a column. So you have the distance \tabcolsep before the first and after the last column and 2\tabcolsep between two columns. If you use @ the code of the argument of @ is added instead of the distance. So @<> just removes the distance.

Additional note: I would recommend to avoid vertical rules in tables (see the manual of package booktabs ) and to use package siunitx for number columns. And I would not center the elements of the first table row but left-align them. And because d=… in the table head is something like math, you should set it in math mode. In this case I also would not make it bold (using, e.g., \boldmath ), because font attributes in math have mostly a semantic (e.g, bold is often used for vectors or sets).