0

I want to create the following type of table for my paper.

enter image description here

How can I do it?

Thank you.

2
  • For horizontal rules not across the whole line you can use \cline{4-7}. To merge cells horizontally you can use \multicolumn{<count>}{<align>}{<contents>}. To merge cells vertically you can use \usepackage{multirow} and \multirow{<count>}{<width>}{<contents>} (use * for <width> to use the contents' natural width).
    – Skillmon
    Nov 6, 2019 at 11:27
  • 2
    Please clarify what it is about the table shown in the screenshot that you wish to reproduce. Maybe the centering of the letter "F" above 6 columns? The irregular column widths? The fact that the contents of almost all cells are left-aligned? Please be specific.
    – Mico
    Nov 6, 2019 at 11:38

1 Answer 1

3

Recreating your table (but with only natural width columns) you can use the following to get the lines like in your example:

\documentclass[]{article}

\begin{document}
\begin{tabular}{|*{10}{l|}}
  \hline
  A & B & C & D & \multicolumn{6}{c|}{F} \\
    &   &   &   & \multicolumn{6}{c|}{}  \\
  \cline{5-10}
    &   &   &   & a & b & c & d & e & f \\
    &   &   &   &   &   &   &   &   &   \\
  \hline
  1 & 1.1 & - & - & - & - & - & - & - & - \\
  \hline
  2 & 1.2 & - & - & - & - & - & - & - & - \\
  \hline
  3 & 1.3 & - & - & - & - & - & - & - & - \\
  \hline
\end{tabular}
\end{document}

ugly results

But: it is considered bad typography to use tables with vertical rules and too many horizontal ones, therefore I'd advice to use the rules provided by booktabs and that you read booktabs documentation (there are a lot of helpful tips concerning good looking tables):

\documentclass[]{article}

\usepackage{multirow}
\usepackage{booktabs}

\newcommand\vcenterhead[1]
  {%
    \multirow{2}{*}[-0.5\dimexpr\aboverulesep+\belowrulesep+\cmidrulewidth\relax]{#1}%
  }

\begin{document}
\begin{tabular}{*{10}{l}}
  \toprule
  \vcenterhead{A} & \vcenterhead{B} & \vcenterhead{C} & \vcenterhead{D} & \multicolumn{6}{c}{F} \\
  \cmidrule(l{.5\tabcolsep}r{.5\tabcolsep}){5-10}
    &   &   &   & a & b & c & d & e & f \\
  \midrule
  1 & 1.1 & - & - & - & - & - & - & - & - \\
  2 & 1.2 & - & - & - & - & - & - & - & - \\
  3 & 1.3 & - & - & - & - & - & - & - & - \\
  \bottomrule
\end{tabular}
\end{document}

booktabs results

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.