Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I try to insert a tabular in my CV using modernCV document like this

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

I don't get any border. It appears that it's not possible to make a tabular in a moderncv. How can I solve this?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

In order for rules in tabular to appear, each document class has to define a positive value for \arrayrulewidth and moderncv either doesn't assign a value or it sets it to 0pt; something similar happens to \tabcolsep; simply assign the standard values for those lengths:

\documentclass{moderncv}

\firstname{A}
\familyname{B}

\setlength\arrayrulewidth{.4pt}
\setlength\tabcolsep{6pt}

\begin{document}

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

\end{document}

enter image description here

In fact, there was an attempt to set these lengths (and some others) in moderncv.cls, but the author decided they were not required; one can see

% not required
%\setlength\arraycolsep{5\p@}
%\setlength\tabcolsep{6\p@}
%\setlength\arrayrulewidth{.4\p@}
%\setlength\doublerulesep{2\p@}
%\setlength\tabbingsep{\labelsep}

in moderncv.cls.

As a personal suggestion, consider removing vertical rules from your tables and using the booktabs package.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.