# Tabular in a moderncv

Hi,

it appears that it's not possible (i.e. no border, no spaces...) to include a tabular in a moderncv document (neither tabularx or array in math mode). I guess it's because some variables are modified in the style file of moderncv.

Any hint to override this?

Best,
F

## Question information

Language:
English Edit question
Status:
Solved
For:
moderncv Edit question
Assignee:
Xavier Danaux Edit question
Solved by:
Flo__
Solved:
2011-11-16
Last query:
2011-11-16
2011-11-16
 Xavier Danaux (xdanaux) said on 2011-11-16: #1

Hi Florian,

Any chance to include a simple example showing the error you get when trying to include a tabular? Moderncv uses tabulars extensively, so there should be no reason you can't use them yourself...

Kind regards,

Xavier

 Flo__ (flooo) said on 2011-11-16: #2

Hi,

I don't have any compilation error, it's just that it doesn't render any tabular on the pdf.

For example, the following code :

$\begin{array}{|c|c|c|} \hline AA & BB & CC \\ \hline DD & EE & FF \end{array}$

\begin{tabular}{|c|c|c|}
\hline aa & bb & cc \\
\hline dd & ee & ff \\
\hline
\end{tabular}

Best,
F

 Xavier Danaux (xdanaux) said on 2011-11-16: #3

Hi Florian,

The array and the tabular are actually rendered perfectly. If you would make the cell contents less similar, you would be able to see that the layout is perfectly rendered as requested.

You are not seeing any vertical line because you have not defined their width, hence they are rendered with a zero width...
What you are looking for, is to set \arrayrulewidth to a non-zero value. You might also want to similarly set \arraycolsep and \tabcolsep to non-zero values to create some space between the columns.

Kind regards,

Xavier

 Flo__ (flooo) said on 2011-11-16: #4

Hi,

Ooups, my bad. In the usual classes, i guess these values are not set to 0 by default.

To solve my problem, I just uncommented the following line of the cls file :
% TO BE TESTED
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}

Thanks !
F

 Dimitrios Apostolou (jimis) said on 2012-09-27: #5

Hello, can't this be fixed inside moderncv? I just spent one hour trying to find out what's wrong with my use of tabular, until I found the answer at [1]. Thanks.

 Xavier Danaux (xdanaux) said on 2012-10-31: #6

I just set \arrayrulewidth to its standard value of 0.4pt by default, but won't set \arraycolsep or \tabcolsep to non-zero values as of now / yet, as moderncv uses tabulars extensively and the code would need to be adapted to take those extra spaces into account.