Graphics, Figures & Tablesmultirow | General problems

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
niles
Posts: 92
Joined: Mon Dec 01, 2008 9:35 pm

multirow | General problems

Post by niles »

Hi

I am trying to make the attached table, but I haven't been succesful so far. I'm pretty sure I have to use the multirow-package. Here's what I got so far:

Code: Select all

\documentclass[10pt, a4paper]{article}

\usepackage[english]{babel}
\usepackage[ansinew]{inputenc}
\usepackage{multirow}

\begin{document}

\begin{center}
\begin{tabular}{|l|l|l|}
\hline
\multirow{1}{*}{}
 & Subjective pronoun            & verb + \\
\hline
\multirow{3}{*}{Singular}
 & I                             & am \\
 & you                           & i  \\
 & (he, she)/it                  &    \\
\hline
\multirow{3}{*}{Plural}
 & we                            & im \\
 & You                           & id \\
 & they                         & and \\
\hline
\end{tabular}
\end{center}

\end{document}
Best,
Niles.
Attachments
example.PNG
example.PNG (4.54 KiB) Viewed 3568 times

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

multirow | General problems

Post by 5gon12eder »

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{multirow}

\setlength{\parskip}{2ex}

\begin{document}
  The first thing is to create a table with the appropriate number of
  cells. Except for special cases, there is no need to make a new row
  for each entry. Instead, use columns of the `p' type. You can put
  multiline stuff in them (using \verb+\newline+).
  
  \begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|}
    \hline
    A &B &C\\
    \hline
    D &E &F\\
    \hline
    G &H &I\\
    \hline
  \end{tabular}
  
  Next span the second and third row in column 1 and adjusting the
  horizontal lines not to go across the entire table.
  
  \begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|}
    \cline{2-3}
    A &B &C\\
    \hline
    \multirow{2}{*}{D} &E &F\\
    \cline{2-3}
    &H &I\\
    \hline
  \end{tabular}
  
  Now get rid of the top left vertical line.
  
  \begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|}
    \cline{2-3}
    \multicolumn{1}{p{3cm}|}{A} &B &C\\
    \hline
    \multirow{2}{*}{D} &E &F\\
    \cline{2-3}
    &H &I\\
    \hline
  \end{tabular}
  
  Here is a final example with more content.
  
  \begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|}
    \cline{2-3}
    \multicolumn{1}{p{3cm}|}{} &Sun &Moon\\
    \hline
    \multirow{2}{*}{Collectables} &The lunatic is on the grass.
    &Remembering games and daisy chains and laughs.\\ 
    \cline{2-3}
    &Got to keep the loonies on the path. 
    &The lunatic is in the hall.\\
    \hline
  \end{tabular}
  
  You can find essentially everything needed to accomplish this
  on\\ \texttt{http://en.wikibooks.org/wiki/LaTeX/Tables}.
\end{document}
Attachments
doc.pdf
(43.51 KiB) Downloaded 240 times
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
niles
Posts: 92
Joined: Mon Dec 01, 2008 9:35 pm

Re: multirow | General problems

Post by niles »

Thanks for the detailed answer. I am trying to

1) Center the "Collectables" entry both horizontally and vertically
2) Make sure that there are three entries in each of the four square boxes from the lower right corner (as in my original attempt).

I'm actually pretty lost on both things. Any suggestions would be much appreciated.

Best.
5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Re: multirow | General problems

Post by 5gon12eder »

You'll find the answer in the reference mentioned in my first reply.
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
niles
Posts: 92
Joined: Mon Dec 01, 2008 9:35 pm

multirow | General problems

Post by niles »

Thanks, I sorted it out -- but I changed the design a little. Have a look:

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{multirow}
\usepackage{array, booktabs, tabularx}

\setlength{\parskip}{2ex}

\begin{document}


\begin{tabular}{l !{\qquad} c !{\qquad} c}
\toprule
& Title 1 & Title 2 \\
\midrule
& Entry 1 & Number 1  \\
\multirow{1}{1.3cm}{S}
& Entry 2 & Number 2 \\
& Entry 3 & Number 3 \\
\midrule
& Entry 1 & Number 1 \\
\multirow{1}{1.3cm}{P}
& Entry 2 & Number 2 \\
& Entry 3 & Number 3 \\
\bottomrule

\end{tabular}
\end{document}
There is one thing I am missing. I am trying to make the following (same as the original, but slightly changed) [see attached].

The only thing I am missing now is the left part, i.e.

1) the line which should be centered around the middle rule
2) extend all other rules besides the middle rule

I am not sure if this is directly related to tables or not, but I'd appreicate any inout you might have. My deadline is unfortunately coming up.

Best.
Attachments
untitled.PNG
untitled.PNG (3.11 KiB) Viewed 3540 times
Post Reply