1

For some reason couple of the thick vertical lines are missing from the first row (still there is the thin line):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{bigstrut}
\usepackage{adjustbox}
\usepackage{makecell}
\usepackage{amssymb}
\usepackage{array}
\newcolumntype{?}{!{\vrule width 2pt}}
\newcolumntype{M}[1]{>{\raggedleft\arraybackslash}m{#1}}

\begin{document}
\renewcommand{\arraystretch}{0.66}
\begin{table}[htbp]
  \centering
  \caption{Review of methods and ...}
  \begin{adjustbox}{center}
  \setlength\tabcolsep{2pt}
    \begin{tabular}{|c?c|c?c|c|c|c|c?c|c|c|}
    \hline
       & \multicolumn{2}{c|}{\linespread{1}\selectfont{}\centering Bugs' info} & \multicolumn{5}{c|}{Expertise info}         & \multicolumn{3}{c|}{Based on} \\
    \hline
    Method & \parbox{1.7cm}{\linespread{1}\selectfont{}\centering Title + description} & \parbox{0.8cm}{\linespread{1}\selectfont{}\centering Meta} & \parbox{1.9cm}{\linespread{0}\selectfont{}\centering Bug fixing; title / description} & \parbox{1.6cm}{\linespread{1}\selectfont{}\centering Being a committer} & \parbox{1.1cm}{\linespread{1}\selectfont{}\centering Tossing history} & \parbox{0.8cm}{\linespread{1}\selectfont{}\centering Meta} & \parbox{1.3cm}{\linespread{1}\selectfont{}\centering Changed code} & \parbox{1.6cm}{\linespread{1}\selectfont{}\centering Final committer} & \parbox{1.3cm}{\linespread{1}\selectfont{}\centering Closer / resolver} & \parbox{1.3cm}{\linespread{1}\selectfont{}\centering Drafted assignee} \\
    \hline
    AA & \checkmark & & \checkmark & & & & & \checkmark & \checkmark & \\\hline
    BB & \checkmark & & \checkmark & & & & & \checkmark & \checkmark & \\\hline
    CC & \checkmark & \checkmark & \checkmark & & \checkmark & \checkmark &  & \checkmark & \checkmark & \\\hline
    \end{tabular}%
    \end{adjustbox}
  \label{tab:previousMethods}%
\end{table}%
\end{document}

enter image description here

  • 1
    you replaced the ? spec by a | by using \multicolumn{2}{c|} I assume you intended \multicolumn{2}{c?} – David Carlisle May 23 '17 at 22:24
  • 1
    unrelated to the vertical rule but \linespread and \centering do nothing in a c cell as that is horizontal mode like \mbox – David Carlisle May 23 '17 at 22:25
1

For more space around cells content use cellspace package and for column headers makecell from makecell package:

In preamble of your MWE add:

\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

and change columns definitions and columns headers to:

   \begin{tabular}{|Sc?c|c?c|Sc|c|c|c?c|c|c|}
    \hline
       & \multicolumn{2}{Sc?}{Bugs' info}
       & \multicolumn{5}{c?}{Expertise info}
       & \multicolumn{3}{c|}{Based on} \\
    \hline
    Method & \makecell{Title +\\ description} & Meta
           & \makecell{Bug fixing;\\ title /\\ description}
           & \makecell{Being a\\ committer}
           & \makecell{Tossing\\ history}
           & Meta
           & \makecell{Changed\\ code}
           & \makecell{Final\\ committer}
           & \makecell{Closer /\\ resolver}
           & \makecell{Drafted\\ assignee} \\

Result:

enter image description here

  • this makes the top and bottom margins much better, but also increases the spacing between lines (e.g, between "Bug Fixing" and "Title"). The idea is that this was just an MWE and the real table was so bigger. So I needed to shrink from all 4 sides. Any ideas? – Alisa May 24 '17 at 2:25
0

Thanks to @David_Carlisle for his constructive comments:

I changed \multicolumn{2}{c|} to \multicolumn{2}{c?} and changed \multicolumn{5}{c|} to \multicolumn{5}{c?}

Here's the answer (note that I also added a vertical thick line for more clarity):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{bigstrut}
\usepackage{adjustbox}
\usepackage{makecell}
\usepackage{amssymb}
\usepackage{array}
\newcolumntype{?}{!{\vrule width 2pt}}
\newcolumntype{M}[1]{>{\raggedleft\arraybackslash}m{#1}}

\begin{document}
\renewcommand{\arraystretch}{0.66}
\begin{table}[htbp]
  \centering
  \caption{Review of methods and ...}
  \begin{adjustbox}{center}
  \setlength\tabcolsep{2pt}
    \begin{tabular}{|c?c|c?c|c|c|c|c?c|c|c|}
    \hline
       & \multicolumn{2}{c?}{\centering Bugs' info} & \multicolumn{5}{c?}{Expertise info}         & \multicolumn{3}{c|}{Based on} \\
    \hline
    Method & \parbox{1.7cm}{\linespread{1}\selectfont{}\centering Title + description} & \parbox{0.8cm}{\linespread{1}\selectfont{}\centering Meta} & \parbox{1.9cm}{\linespread{0}\selectfont{}\centering Bug fixing; title / description} & \parbox{1.6cm}{\linespread{1}\selectfont{}\centering Being a committer} & \parbox{1.1cm}{\linespread{1}\selectfont{}\centering Tossing history} & \parbox{0.8cm}{\linespread{1}\selectfont{}\centering Meta} & \parbox{1.3cm}{\linespread{1}\selectfont{}\centering Changed code} & \parbox{1.6cm}{\linespread{1}\selectfont{}\centering Final committer} & \parbox{1.3cm}{\linespread{1}\selectfont{}\centering Closer / resolver} & \parbox{1.3cm}{\linespread{1}\selectfont{}\centering Drafted assignee} \\
%     \hline
    \Xhline{6\arrayrulewidth}
    AA & \checkmark & & \checkmark & & & & & \checkmark & \checkmark & \\\hline
    BB & \checkmark & & \checkmark & & & & & \checkmark & \checkmark & \\\hline
    CC & \checkmark & \checkmark & \checkmark & & \checkmark & \checkmark &  & \checkmark & \checkmark & \\\hline
    \end{tabular}%
    \end{adjustbox}
  \label{tab:previousMethods}%
\end{table}%
\end{document}

enter image description here

  • You seem to love horizontal rules that touch the contents… – Bernard May 23 '17 at 22:52
  • @Bernard, I even commented \renewcommand{\arraystretch}{1}, but still the three line title (e.g., "Bug Fixing; ..." is touching the lines (top and bottom). Any ideas (other than removing the horizontal lines)? – Alisa May 23 '17 at 23:17
  • 1
    You can use \setlength{\extrarowheight}{2pt} (or 3pt). Also since you load makecell, \setcellgapes{3pt}\makegapedcells inside the table environment. – Bernard May 23 '17 at 23:55
0

I propose this other layout, with rows and columns switched, and less horizontal and vertical rules. The caption package is loaded to ensure a decent vertical spacing between table and caption above:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{bigstrut}
\usepackage{makecell, booktabs, caption}
\usepackage{amssymb}
\usepackage{array}
\usepackage[table, svgnames]{xcolor}
\newcolumntype{M}[1]{>{\raggedleft\arraybackslash}m{#1}}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}

\begin{document}

\begin{table}[htbp]
  \centering
  \renewcommand{\arraystretch}{0.66}
  \caption{Review of methods and ...}
  \setcellgapes{3pt}\makegapedcells
  \arrayrulecolor{Gainsboro}
  \begin{tabular}{!{\color{Gainsboro}\vrule width2pt}llccc!{\color{Gainsboro}\vrule width2pt}}
    \specialrule{2pt}{0pt}{0pt}
    \multicolumn{2}{!{\color{Gainsboro}\vrule width2pt}c}{Method} & AA & BB & CC \\
    \specialrule{0.6pt}{0pt}{0pt}
    \multicolumn{5}{!{\color{Gainsboro}\vrule width2pt}l !{\color{Gainsboro}\vrule width2pt}}{\bigstrut\em Bugs info} \\
      & Title +description & \checkmark & \checkmark & \checkmark \\
      & Meta & & & \checkmark \\
    \specialrule{0.6pt}{0pt}{0pt}
    \multicolumn{5}{!{\color{Gainsboro}\vrule width2pt}l !{\color{Gainsboro}\vrule width2pt}}{\em Expertise info}\\
    & \makecell[l]{Bug fixing;\\ title/description} & \checkmark & \checkmark & \checkmark \\
      & Being a committer & & & \\
      & Tossing history & & & \checkmark \\
      & Meta & & & \checkmark \\
      & Changed code & & & \\
    \specialrule{0.6pt}{0pt}{0pt}
    \multicolumn{5}{!{\color{Gainsboro}\vrule width2pt}l !{\color{Gainsboro}\vrule width2pt}}{\bigstrut\em Based on} \\
      & Final committer & \checkmark & \checkmark & \checkmark \\
      & Closer/resolver & \checkmark & \checkmark & \checkmark \\
      & Drafted assignee & & & \\
    \specialrule{2pt}{0pt}{0pt}
  \end{tabular}%
  \label{tab:previousMethods1}%
\end{table}

\end{document} 

enter image description here

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.