I'm trying to make a table, but some vertical lines are missing. Could someone help me to see the mistake?
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{dsfont}
\parindent0em
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{multirow}
\begin{document}
\begin{tabular}{c|c|c|c|c|c|c|c|}
\cline{2-8} & \multicolumn{1}{c|}{Generacion} & Nombre & Simbolo & Masa(eV) & Espin & Carga($e$) & Color \\ \cline{1-8}
\multicolumn{1}{ |c| }{\multirow{3}{*}{Quarks} } & \multirow{2}{*}{1a} & UP & 2 & 0 & 1 &5& 5\\
& \multicolumn{1}{ |c| }{} & UP & 2 & 0 & 1 &5& 5\\ \cline{2-8}
\multicolumn{1}{ |c| }{}& \multirow{2}{*}{2a} & UP & 2 & 0 & 1 &5& 5\\
&\multicolumn{1}{ |c| }{} & UP & 2 & 0 & 1 &5& 5\\ \cline{2-8}
\multicolumn{1}{ |c| }{} & \multirow{2}{*}{3a} & UP & 2 & 0 & 1 &5& 5\\
&\multicolumn{1}{ |c| }{} & UP & 2 & 0 & 1 &5& 5\\ \cline{1-8}
\cline{1-8}
\multicolumn{1}{ |c| }{\multirow{3}{*}{Leptones} } & \multirow{2}{*}{1a} & UP & 2 & 0 & 1 &5& 5\\
& & UP & 2 & 0 & 1 &5& 5\\ \cline{2-8}
\multicolumn{1}{ |c| }{} & \multirow{2}{*}{2a} & UP & 2 & 0 & 1 &5& 5\\
& & UP & 2 & 0 & 1 &5& 5\\ \cline{2-8}
\multicolumn{1}{ |c| }{} & \multirow{2}{*}{3a} & UP & 2 & 0 & 1 &5& 5\\
& & UP & 2 & 0 & 1 &5& 5\\ \cline{1-8}
\cline{1-8}
\multicolumn{2}{|c|}{\multirow{5}{*}{Bosones}} & UP & 2 & 0 & 1 &5& 5\\
\multicolumn{2}{|c|}{} & UP & 2 & 0 & 1 &5& 5\\
\multicolumn{2}{|c|}{} & UP & 2 & 0 & 1 &5& 5\\
\multicolumn{2}{|c|}{} & UP & 2 & 0 & 1 &5& 5\\ \cline{3-8}
\multicolumn{2}{|c|}{} & UP & 2 & 0 & 1 &5& 5\\ \cline{3-8}
\cline{1-8}
\end{tabular}
\end{document}
Thanks
Best Answer
An important issue not mentioned in your posting is that the table is too wide to fit inside the text block. This may be remedied by (i) placing the units in two of the header cells in a separate row and (ii) reducing the value of
\tabcolsep
, the parameter that governs the amount of intercolumn whitespace, by a third (from6pt
to4pt
.The table code is, I hope you don't mind the criticism, rather cluttered. It may be simplified considerably by (a) setting the structure via
and (b) getting rid of the multitude of
\multicolumn{1}{ |c| }{}
directives. Do also replace all\cline{1-8}
directives with\hline
and drop the three redundant\cline
instructions.Optional: All these vertical and horizontal lines do not contribute to the table's legibility and intelligibility; I would assume that these two criteria are important to your work. Dropping all vertical lines, replacing the
\cline
instructions with a bit of (vertical) whitespace, and using the rule-drawing macros (\toprule
,\midrule
, and\bottomrule
) of the booktabs package gives you the following look -- I hope you will agree that it looks at least as good as the table above: