# tabular - \cline not working

I have this table

\begin{tabular}{ | p{2cm} | p{4cm} | p{4cm} | p{4cm} | }
\hline
Název & \multicolumn{3}{ l }{vypsatZapojeniResiteluDoProjektu} \vline\\
\hline
Popis & \multicolumn{3}{ l }{Vedouci pracovnik}  \vline \\
\hline
Priorita & 1 = vysoka & \textbf{Frekvence} & nekolikrat denne \\
\hline
Vstupni podminky & \multicolumn{3}{p{12cm}}{sdgsdgsg.} \vline \\
\hline
Vystupni podminky & \multicolumn{3}{p{12cm}}{sdgsdgsga.} \vline \\
\hline
Uzivatele & \multicolumn{3}{p{12cm}}{sdgsdgsdg.} \vline \\
\hline
\multirow{3}{2pt}{Zakladni posloupnost} & \multicolumn{3}{p{12cm}}{sgdsgsdg.} \vline \\
\cline{2-4}
& \multicolumn{3}{p{12cm}}{sdgsdgg.} \vline \\
\cline{2-4}
& \multicolumn{3}{p{12cm}}{sgsdggdsg.} \vline \\
\hline
\end{tabular}


But \cline doesn't work and my LaTeX IDE singalize some error. I need to have hline only by last 3 columns.

## migrated from stackoverflow.comDec 4 '11 at 2:17

This question came from our site for professional and enthusiast programmers.

• I couldn't reproduce the problem -- your table seems to compile fine when it's in a simple tex file (with the multirow package). What error is your IDE giving you? What happens when you try to compile your document from the command line? – Seth Dec 4 '11 at 0:56
• Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Dec 4 '11 at 2:25
• It is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages, which is probably the issue in this case. Are you including \usepackage{multirow}? Once I add that and put the \documentclass{article} \begin{document}...\end{document} wrapper this compile just fine. – Peter Grill Dec 4 '11 at 2:42

Your table, after suitable completion, will compile with some warnings about over/under full boxes which I solved with the following modifications:

\documentclass{article}
\usepackage[textwidth=17cm]{geometry}% just for the example
\usepackage{multirow}

\begin{document}

\noindent\begin{tabular}{ | p{2cm} | p{4cm} | p{4cm} | p{4cm} | }
\hline
Název & \multicolumn{3}{ l|}{vypsatZapojeniResiteluDoProjektu}\\
\hline
Popis & \multicolumn{3}{ l|}{Vedouci pracovnik}  \vline \\
\hline
Priorita & 1 = vysoka & \textbf{Frekvence} & nekolikrat denne \\
\hline
\parbox[t]{2cm}{Vstupni\\ podminky} & \multicolumn{3}{p{12cm}|}{sdgsdgsg.}\\
\hline
\parbox[t]{2cm}{Vystupni\\ podminky} & \multicolumn{3}{p{12cm}|}{sdgsdgsga.}\\
\hline
Uzivatele & \multicolumn{3}{p{12cm}|}{sdgsdgsdg.}\\
\hline
\cline{2-4}
& \multicolumn{3}{p{12cm}|}{sdgsdgg.}\\
\cline{2-4}
& \multicolumn{3}{p{12cm}}{sgsdggdsg.} \vline \\
\hline
\end{tabular}

\end{document}


And here's the result:

I would like to suggest you, however, some changes to your table, using the features provided by the booktabs package:

\documentclass{article}
\usepackage[textwidth=16cm]{geometry}% just for the example
\usepackage{multirow}
\usepackage{booktabs}

\begin{document}

\noindent\begin{tabular}{@{}p{2cm}p{4cm}@{}p{4cm}@{}p{4cm}@{}}
\toprule
Název & \multicolumn{3}{ l }{vypsatZapojeniResiteluDoProjektu} \\
\midrule
Popis & \multicolumn{3}{ l }{Vedouci pracovnik}  \\
\midrule
Priorita & 1 = vysoka & \textbf{Frekvence} & nekolikrat denne \\
\midrule
\parbox[t]{2cm}{Vstupni\\ podminky} & \multicolumn{3}{p{12cm}}{sdgsdgsg.} \\
\midrule
\parbox[t]{2cm}{Vystupni\\  podminky} & \multicolumn{3}{p{12cm}}{sdgsdgsga.} \\
\midrule
Uzivatele & \multicolumn{3}{p{12cm}}{sdgsdgsdg.} \\
\midrule
\cmidrule{2-4}
& \multicolumn{3}{p{12cm}}{sdgsdgg.} \\
\cmidrule{2-4}
& \multicolumn{3}{p{12cm}}{sgsdggdsg.} \\
\bottomrule
\end{tabular}

\end{document}


Now the table has the following aspect:

As you can see, the spacing between the horizontal lines and the cell contents has improved; also, the absence of vertical rules improves the readability (vertical rules are superfluous). Depending on the actual content of the cells, it would even be possible to remove more lines; refer to the package documentation to see additional features provided by booktabs.

I had this problem too and it was caused by the combination of "-" and \usepackage[czech]{babel}.

I solved it by inserting \catcode-=12` into the table.

(source: http://www.abclinuxu.cz/tex/poradna/show/325037#7 Unfortunately only in Czech)