I'm trying to create my personal CV using moderncv
package but I'm getting an error: in language skills section I'd like to insert a table resuming my skills using the code as follows
\section{Languages}
\cvitemwithcomment{Italian}{Mother tongue}{}
\cvitemwithcomment{English}{\begin{table}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{Understanding} & \multicolumn{2}{c|}{Speaking} & Writing \\ \hline
Listening & Reading & Spoken interaction & Spoken production & - \\ \hline
C1 & C1 & C1 & B2 & B2 \\ \hline
\end{tabular}
\end{table}}{}
\cvitemwithcomment{Spanish}{\begin{table}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{Understanding} & \multicolumn{2}{c|}{Speaking} & Writing \\ \hline
Listening & Reading & Spoken interaction & Spoken production & - \\ \hline
B2 & B2 & B1 & B1 & B1 \\ \hline
\end{tabular}
\end{table}}{}
However, while compiling I get these repeated errors:
Environment table undefined. \end{table}}{}
\begin{document} ended by \end{table}. \end{table}}{}
\begin{minipage} on input line 131 ended by \end{table}. \end{table}}{}
and compilation is blocked.
Could someone give me some hint to solve this problem?
Best Answer
Don't use float environments, such as
table
orfigure
, inmoderncv
; since it makes no sense to have floating objects in a CV, they are not implemented by the class: notice also that the length\tabcolsep
is not set by the class, so it has0pt
as value; you need to change it using something likeotherwise, there will be no separation between columns in tabular material. Your code with those recommendations:
As a side note, your tables have too many lines. Here I changed the tables slightly and used the features provided by the
booktabs
package: