3

the vertical lines of my first row aren't joining my \toprule despite having specified vertical separators in the multicolumn command. Please help!

\begin{table*}[!h]\centering 
    \ra{0.8} 
    \begin{tabular}{|c|  c  c  c  c  c   c  c | c  c  c| }
        \toprule
        & \multicolumn{7}{|c|}{Blast facing side} & \multicolumn{3}{c|}{Rear face of plate}\\ 
        Plate & \multicolumn{4}{|c}{Deposition of burned material} & \multicolumn{3}{c|}{Dome inner surface} & Darkened & Ring around & Lines next \\ 
        & None & Fine & Moderate & Dense & Smooth & Dimples & Cross hatch & dome & dome & to dome \\ 
        \midrule
        BC50SOD & $\checkmark$ &  &  &  & $\checkmark$ &  &  &  &  &  \\ 
        BC60SOD &  & $\checkmark$ &  &  & $\checkmark$ &  &  &  &  &  \\ 
        BC75SOD &  & $\checkmark$ &  &  & $\checkmark$ &  &  &  &  &  \\ 
        36C50SOD &  &  & $\checkmark$ &  &  &  &  &  &  &  \\ 
        36C60SOD &  &  & $\checkmark$  &   &  & $\checkmark$ & $\checkmark$ &  & $\checkmark$  & $\checkmark$ \\ 
        36C75SOD &  &  & $\checkmark$ &  &  &  & $\checkmark$  & $\checkmark$ &  & $\checkmark$  \\ 
        36C80SOD & &  & $\checkmark$ &  &  &  &  &  & $\checkmark$ & $\checkmark$ \\ 
        36C90SOD & &  & $\checkmark$ &  &  &  & $\checkmark$ & $\checkmark$ &  & $\checkmark$ \\ 
        36C100SOD & &  & $\checkmark$ &  &  &  &  & $\checkmark$ &  & $\checkmark$ \\ 
        36C120SOD & &  & $\checkmark$ &  &  &  & $\checkmark$ &  & $\checkmark$ &  \\ 
        \bottomrule
    \end{tabular} 
    \caption{caption} 
    \label{tab:restults} 
\end{table*}

enter image description here

2
  • 1
    What is the \ra command? Please always post full compilable posts.
    – Bernard
    Commented Oct 24, 2016 at 8:33
  • \newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}} Commented Oct 24, 2016 at 8:50

3 Answers 3

2

You're using booktabs, which should not be used with vertical rules if you want professional-looking tables.

The reason for this behaviour comes the fact that these rules add some vertical padding around them which breaks vertical rules. If you want to have full vertical rules, you have to delete this padding, adding

\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}

but you lose one of the main interests of booktabs.

You can replace this padding loading cellspace, which allows to define a minimal vertical spacing at the top and bottom of cells, or makecell which allows to add a fixed spacing at the top and bottom of cells and, incidentally, also defines lines of variable thickness.

2
  • Thanks this seems to do the trick for the most part. There are still very tiny little gaps at the top. But of course now all my other tables are ruined! Commented Oct 24, 2016 at 8:47
  • You can make the changes local to this table: the changes need not be in the preamble.
    – Bernard
    Commented Oct 24, 2016 at 8:55
0

Use \hline instead of \toprule and \midrule or simply do not use vertical lines at all!

\def\arraystretch{0.8}
    \begin{tabular}{|c|  c  c  c  c  c   c  c | c  c  c| }
        \hline
        & \multicolumn{7}{|c|}{Blast facing side} & \multicolumn{3}{c|}{Rear face of plate}\\ 
        Plate & \multicolumn{4}{|c}{Deposition of burned material} & \multicolumn{3}{c|}{Dome inner surface} & Darkened & Ring around & Lines next \\ 
        & None & Fine & Moderate & Dense & Smooth & Dimples & Cross hatch & dome & dome & to dome \\ 
        \hline
        BC50SOD & $\checkmark$ &  &  &  & $\checkmark$ &  &  &  &  &  \\ 
        BC60SOD &  & $\checkmark$ &  &  & $\checkmark$ &  &  &  &  &  \\ 
        BC75SOD &  & $\checkmark$ &  &  & $\checkmark$ &  &  &  &  &  \\ 
        36C50SOD &  &  & $\checkmark$ &  &  &  &  &  &  &  \\ 
        36C60SOD &  &  & $\checkmark$  &   &  & $\checkmark$ & $\checkmark$ &  & $\checkmark$  & $\checkmark$ \\ 
        36C75SOD &  &  & $\checkmark$ &  &  &  & $\checkmark$  & $\checkmark$ &  & $\checkmark$  \\ 
        36C80SOD & &  & $\checkmark$ &  &  &  &  &  & $\checkmark$ & $\checkmark$ \\ 
        36C90SOD & &  & $\checkmark$ &  &  &  & $\checkmark$ & $\checkmark$ &  & $\checkmark$ \\ 
        36C100SOD & &  & $\checkmark$ &  &  &  &  & $\checkmark$ &  & $\checkmark$ \\ 
        36C120SOD & &  & $\checkmark$ &  &  &  & $\checkmark$ &  & $\checkmark$ &  \\ 
        \hline
    \end{tabular}   

enter image description here

2
  • Still have the same problem when using \hline. I'm a big fan of not using vertical lines but this particular table becomes impossible to read without them! Commented Oct 24, 2016 at 8:48
  • see my edited example that it works.
    – user2478
    Commented Oct 24, 2016 at 8:53
0

If you really want to use vertical rules compatible with the rules of booktabs (even if this is not in the spirit of booktabs) you may use {NiceTabular} of nicematrix. Remark that in that environment, you must not put back the vertical rules (with |) in the instructions \multicolumn.

\documentclass[landscape]{article}
\usepackage{nicematrix}
\usepackage{booktabs}
\usepackage{amsfonts}

\begin{document}

\begin{table*}[!h]\centering 
\renewcommand{\arraystretch}{0.8}
\begin{NiceTabular}{|c|  c  c  c  c  c   c  c | c  c  c| }
    \toprule
    & \multicolumn{7}{c}{Blast facing side} & \multicolumn{3}{c}{Rear face of plate}\\ 
    Plate & \multicolumn{4}{c}{Deposition of burned material} & \multicolumn{3}{c}{Dome inner surface} & Darkened & Ring around & Lines next \\ 
    & None & Fine & Moderate & Dense & Smooth & Dimples & Cross hatch & dome & dome & to dome \\ 
    \midrule
    BC50SOD & $\checkmark$ &  &  &  & $\checkmark$ &  &  &  &  &  \\ 
    BC60SOD &  & $\checkmark$ &  &  & $\checkmark$ &  &  &  &  &  \\ 
    BC75SOD &  & $\checkmark$ &  &  & $\checkmark$ &  &  &  &  &  \\ 
    36C50SOD &  &  & $\checkmark$ &  &  &  &  &  &  &  \\ 
    36C60SOD &  &  & $\checkmark$  &   &  & $\checkmark$ & $\checkmark$ &  & $\checkmark$  & $\checkmark$ \\ 
    36C75SOD &  &  & $\checkmark$ &  &  &  & $\checkmark$  & $\checkmark$ &  & $\checkmark$  \\ 
    36C80SOD & &  & $\checkmark$ &  &  &  &  &  & $\checkmark$ & $\checkmark$ \\ 
    36C90SOD & &  & $\checkmark$ &  &  &  & $\checkmark$ & $\checkmark$ &  & $\checkmark$ \\ 
    36C100SOD & &  & $\checkmark$ &  &  &  &  & $\checkmark$ &  & $\checkmark$ \\ 
    36C120SOD & &  & $\checkmark$ &  &  &  & $\checkmark$ &  & $\checkmark$ &  \\ 
    \bottomrule
\end{NiceTabular} 
\caption{caption} 
\end{table*}

\end{document}

Output of the above code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .