1

I need to build a table that looks like this:

enter image description here

Quite obviously the \multirow package must be what I'm looking for, but every example I've seen so far only shows how to do this the other way around - that is, we don't want to "divide" the first column, but the second or etc. Is there any way around this? What i am (stupidly) missing? Thank you in advance.

5
  • A similar question, slightly different table to be found here: tex.stackexchange.com/questions/178680/…
    – user31729
    May 19, 2014 at 13:47
  • Similar also to tex.stackexchange.com/questions/178976/… May 19, 2014 at 13:50
  • Will the table have any real content? If so, how should the alignment be in the right column? May 19, 2014 at 14:12
  • @GonzaloMedina yes, it will, and it should be left-aligned but on the middle (vertical-wise) of the cell. i'll edit accordingly.
    – essay
    May 19, 2014 at 14:15
  • 1
    @sylvia Well then have a look on my third example in the answer below. It should cover your needs.
    – LaRiFaRi
    May 19, 2014 at 14:19

2 Answers 2

2

A solution with booktabs as vertical lines are distracting the reader. If you need them, just use my snippet below with |l|l| and normal \hline and \cline{1-1} commands.

% arara: pdflatex

\documentclass{article}
\usepackage{booktabs} % my recommendation. Used in first and second version
\usepackage{multirow} % just for the second and third version
\usepackage{caption} % optional for nicer vertical spacing

\begin{document}

\begin{table}%
 \caption{Your Table}
 \centering
 \begin{tabular}{ll}
  \toprule
  top left&right\\
  \cmidrule(r){1-1}
  bottom left&\\
  \bottomrule
 \end{tabular}
\end{table}

\begin{table}%
 \caption{Your Table with Centered Right Side}
 \centering
 \begin{tabular}{ll}
  \toprule
  top left&\multirow{2}{*}{centered right}\\
  \cmidrule(r){1-1}
  bottom left&\\
  \bottomrule
 \end{tabular}
\end{table}

\begin{table}%
 \caption{Your Table with Vertical Lines}
 \centering
 \begin{tabular}{|l|l|}
  \hline
  top left&\multirow{2}{*}{centered right}\\
  \cline{1-1}
  bottom left&\\
  \hline
 \end{tabular}
\end{table}

\end{document}

The (r) is optional. Have a look, if you like it more without this constraint.

enter image description here

1

A great online utility for creating LaTeX tables visually: http://www.tablesgenerator.com/ gives:

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
% \usepackage{multirow}
% \usepackage{graphicx}
\begin{table}[h]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{@{}lllll@{}}
\toprule
 & \multirow{2}{*}{} &  &  &  \\ \cmidrule(r){1-1} \cmidrule(l){3-5} 
 &  &  &  &  \\ \cmidrule(lr){2-2}
 &  &  &  &  \\
 &  &  &  &  \\ \bottomrule
\end{tabular}
}
\end{table}
3
  • Please post complete answers and not just fragments of code
    – user31729
    May 19, 2014 at 14:38
  • What do you think is missing?
    – Jool
    May 19, 2014 at 14:39
  • \documentclass{...} and \begin{document} ... \end{document} ;-)
    – user31729
    May 19, 2014 at 14:40

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