[Tex/LaTex] Table padding in LyX


I'm creating in LyX a table wich has a single character for every cell. Problem is, a lot of space is wasted, because each cell has some padding points which I'd like to reduce.
A cell is now big enough to contain 3 characters, but I need them to be a little bigger than the character itself. Ideal objective is to get all the cells square shaped of equal size.

A screenshot is attached to let you understand what I'd like to accomplish (they are not really regular as my drawing skills are poor :P)

I tried with this thread Column and row padding in tables but without luck: cells are still wide.

What can I do?

Thanks in advance

A table with reduced padding and square cells

Best Answer

You may want to change the value of \tabcolsep, a length variable that equals (half) the width of the whitespace that separates columns. You use the command \setlength to change the value of this length variable. The default value of this variable is 6pt (if the main text's font size is 10pt); a value of 3pt will give you a rather tightly-set group of columns.

Separately, you may also want to consider eliminating the vertical rules between columns entirely. When one has a lot of columns, the vertical rules tend to take up a lot of space while not adding appreciably to the table's readability.

The following code and the associated image illustrate the effects that reducing the value of \tabcolsep from 6pt to 4, 3, and 2pt has. In all cases, I've eliminated all vertical rules.

\usepackage{booktabs} % for well-spaced horizontal rules
\newcommand{\quicktabular}{%  this construct will be used several times
A & B & C & D & E & F & G & H & I & J \\
A & B & C & D & E & F & G & H & I & J \\
\item Default value of \texttt{\textbackslash tabcolsep} (6pt)


\item \texttt{\textbackslash tabcolsep} = 4pt


\item \texttt{\textbackslash tabcolsep} = 3pt


\item \texttt{\textbackslash tabcolsep} = 2pt



enter image description here