Graphics, Figures & TablesMultirow: "Taller" second! cell

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
tjaenare
Posts: 30
Joined: Tue Nov 11, 2008 3:49 pm

Multirow: "Taller" second! cell

Post by tjaenare »

Hello!
I am quite new to LaTeX and try to make my first table. The problem is I have not found any possibility to make it look like I would like due to contentwise reasons. In the end, the ideal table look would somehow be as follows so that "line1b" is centred compared to Line1a and Line2a:

Code: Select all

______________
   Headl1
Head2 | Head3
______________
Line1a|
      |Line1b
Line2a|
______________
Line3a|Line2b
______________
Line4a|Line4b
______________
Unfortunately, I could only do it converted, so lines a and b are switched. Is there any way to bring it to the "right" place?

Here is how far I got:

Code: Select all

\documentclass[a4paper,12pt,draft,headsepline]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[ngerman,british]{babel}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{colortbl}

\begin{document}

\begin{center}\begin{tabular}{c|c}\hline\hline
 \multicolumn{2}{>{\columncolor[rgb]{0.8,0.8,0.8}}c}{Types of \ldots}\\ \hline
 \rowcolor[rgb]{0.8,0.8,0.8} Healthcare States & Welfare States\\ \hline 
 \multirow{2}{*}{Liberal} & Pay on your own \\ & Charity\\ \hline 
 Provision & Social-democratic\\ \hline
 Insurance & Conservative\\ \hline
\end{tabular}\end{center}

\end{document}
Thanks a lot in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

marco_d
Posts: 57
Joined: Tue Jan 20, 2009 7:49 pm

Multirow: "Taller" second! cell

Post by marco_d »

Hello,

I don't know whether I understand you in the right way:

Code: Select all

\documentclass[a4paper,12pt,draft,headsepline]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman,british]{babel}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{colortbl}

\begin{document}

\begin{center}\begin{tabular}{c|c}\hline\hline
\multicolumn{2}{>{\columncolor[rgb]{0.8,0.8,0.8}}c}{Types of \ldots}\\ \hline
\rowcolor[rgb]{0.8,0.8,0.8} Healthcare States & Welfare States\\ \hline
 Pay on your own &\multirow{3}{*}{Liberal} \\ & \\[-0.8ex] Charity & \\ \hline
Provision & Social-democratic\\ \hline
Insurance & Conservative\\ \hline
\end{tabular}\end{center}

\end{document}


regards
Marco
i am German. I can not use difficult words. :-)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10344
Joined: Mon Mar 10, 2008 9:44 pm

Multirow: "Taller" second! cell

Post by Stefan Kottwitz »

Hi,

you could use the array package and columns with the formatting parameter m instead of c, have a look at the array documentation.
To get general ideas for beautiful tables have a look at tabsatz.pdf, even though the text is written in German.

Stefan
LaTeX.org admin
tjaenare
Posts: 30
Joined: Tue Nov 11, 2008 3:49 pm

Multirow: "Taller" second! cell

Post by tjaenare »

Thank you both for your suggestions! It was exactly what I was looking for and with the small change, Marco, to take out the middle line on the left hand side it is looking as intended:

Code: Select all

\begin{center}\begin{tabular}{c|c}\hline\hline
\multicolumn{2}{>{\columncolor[rgb]{0.8,0.8,0.8}}c}{Types of \ldots}\\ \hline
\rowcolor[rgb]{0.8,0.8,0.8} Healthcare States & Welfare States\\ \hline
Pay on your own &\multirow{2}{*}{Liberal} \\ Charity & \\ \hline
Provision & Social-democratic\\ \hline
Insurance & Conservative\\ \hline
\end{tabular}\end{center}
I have not used the array package so far, Stefan. With a first overview it looks very promising for all kinds of manipulation and finetuning of tables. Definitively a new entry on my LaTeX-to-do-list!

Thanks a lot!
marco_d
Posts: 57
Joined: Tue Jan 20, 2009 7:49 pm

Multirow: "Taller" second! cell

Post by marco_d »

tjaenare wrote:Definitively a new entry on my LaTeX-to-do-list!
Hello,

don't forget the package booktabs ;)

regards
Marco
i am German. I can not use difficult words. :-)
Post Reply