7

I want to make a table with rules that are thicker than the default. It's pretty straightforward to do, however the result looks bad: the lines have gaps in them (see image below). There must be a way to make this look better.

\documentclass{article}
\setlength{\arrayrulewidth}{2pt}
\begin{document}
  \begin{tabular}{|c|c|}
    \hline
    hello & world \cr
    \hline
    hello & world \cr
    \hline
  \end{tabular}
\end{document}

enter image description here

3
11

Add \usepackage{array}. However, in general, vertical lines in tables are frowned upon and you should use them only if there's a good reason for it. As well, in LaTeX tabular-like environments, the macro \\ is prefered over \cr.

enter image description here

\documentclass{article}
\pagestyle{empty}
\setlength{\arrayrulewidth}{2pt}
\usepackage{array}
\begin{document}
  \begin{tabular}{|c|c|}
    \hline
    hello & world \\
    \hline
    hello & world \\
    \hline
  \end{tabular}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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