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.

essay
  • 345
  • A similar question, slightly different table to be found here: http://tex.stackexchange.com/questions/178680/multicols-and-multirows-table/178682#178682 –  May 19 '14 at 13:47
  • Similar also to http://tex.stackexchange.com/questions/178976/how-to-color-a-cell-of-a-table-using-multirow-and-center-the-cell-content – Steven B. Segletes May 19 '14 at 13:50
  • Will the table have any real content? If so, how should the alignment be in the right column? – Gonzalo Medina May 19 '14 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 '14 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 '14 at 14:19

2 Answers2

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

flor1an
  • 797
LaRiFaRi
  • 43,807
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}
Jool
  • 331