3

hi I have this code

\begin{table}[h]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{c|c|c|c|c|c|c|}
\cline{2-7}
 & Windows Forms & PDF & Windows Forms/GDI+ & Windows Media Player & Direct3D & \textbf{WPF} \\ \hline
\multicolumn{1}{|c|}{Grafické rozhranie} & X &  &  &  &  & \textbf{X} \\ \hline
\multicolumn{1}{|c|}{Dokumenty na obrazovke} & X &  &  &  &  & \textbf{X} \\ \hline
\multicolumn{1}{|c|}{Dokumenty s pevným,formátom} &  & X &  &  &  & \textbf{X} \\ \hline
\multicolumn{1}{|c|}{Obrázky} &  &  & X &  &  & \textbf{X} \\ \hline
\multicolumn{1}{|c|}{Video a zvuk} &  &  &  & X &  & \textbf{X} \\ \hline
\multicolumn{1}{|c|}{2D grafika} &  &  & X &  &  & \textbf{X} \\ \hline
\multicolumn{1}{|c|}{3D grafika} &  &  &  &  & X & \textbf{X} \\ \hline
\end{tabular}
\end{table}`

and I have this error

File ended while scanning use of \@cline

Can you help me pls?

Mico
  • 506,678
Tomas
  • 31
  • 3
    I'm sorry, this code (completed) compiles fine. Could you post a minimal complete example that reproduces the problem? – Bernard Dec 07 '15 at 19:38
  • 2
    Testing your code within \documentclass{article}\begin{document}\end{document} compiles without issue for me... although the table doesn't fit the page at all. – BMWurm Dec 07 '15 at 19:38
  • for me, without \cline{2-7} it is working ... but with this nope – Tomas Dec 07 '15 at 20:37
  • 1
    Perhaps you have \usepackage[czech]{babel} or \usepackage[slovak]{babel}, can you confirm? – egreg Dec 07 '15 at 20:49

1 Answers1

2

I am also unable to reproduce the error message you say you're getting. At any rate, I'd like to suggest that get rid of the \cline instruction and modify your table to give it a much more open look, by (a) getting rid of all vertical lines, (b) getting rid of most of the horizontal lines generated by \hline, and (c) using the macros \toprule, \midrule, and \bottomrule of the booktabs package for the remaining horizontal lines.

Moreover, in order to give the table a fighting chance to fit insde the text block, I would further like to suggest that you use a tabularx environment with an overall width of \textwidth and use automatic line wrapping for three of the six data columns.

A final comment: What might be the purpose of boldfacing all entries in the final column?

enter image description here

\documentclass{article} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page size parameters

\usepackage{tabularx,ragged2e,booktabs}
% define a centered version of the "X" column type
\newcolumntype{C}{>{\Centering\arraybackslash}X}

\usepackage[skip=0.5\baselineskip]{caption}
\begin{document}

\begin{table}[h]
\caption{My caption}
\label{my-label}
\begin{tabularx}{\textwidth}{@{} l CcCCcc @{}}
\toprule
 & Windows Forms & PDF & Windows Forms\slash GDI+ & 
  Windows Media Player & Direct3D & \textbf{WPF} \\ 
\midrule
Grafické rozhranie & X &  &  &  &  & \textbf{X} \\ 
Dokumenty na obrazovke & X &  &  &  &  & \textbf{X} \\ 
Dokumenty s pevným, formátom &  & X &  &  &  & \textbf{X} \\ 
Obrázky &  &  & X &  &  & \textbf{X} \\ 
Video a zvuk &  &  &  & X &  & \textbf{X} \\ 
2D grafika &  &  & X &  &  & \textbf{X} \\ 
3D grafika &  &  &  &  & X & \textbf{X} \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}

Postscript: Happily, this code is compatible with the babel package and the use of either the czech or the slovak language option.

Mico
  • 506,678
  • I assumed the boldface in the final column is there because that is the most important point. Personally, I'd be using a light non-intrusive colour that highlates the column without smacking you in the face with Look at ME! ("colour" meaning light grey [black!25 at most] or something like that) – BMWurm Dec 07 '15 at 20:43
  • @BMWurm - Your guess seems on target. If "WPF" is indeed the most important part of the table, though, I'd move it to the first data column, rather than place it last. The idea of highlighting the entire WPF column with a not-too-obtrusive color -- and not using bold-facing -- is also worth pursuing. – Mico Dec 07 '15 at 20:47