Tim
Tim

Reputation: 99418

Multiple lines in a cell of a table

I have a table as shown in this figure:

alt text

The LaTeX code for the table is:

\begin{table}  
\begin{tabular}{ | c | c | }  
  \hline  
  \includegraphics[scale=0.45]{../0_1.eps} & 1.10 2.20 3.30 4.40 \\  
  \hline   
\end{tabular}  
\end{table}

I would like to make the four numbers appear in different lines inside the second cell, in order to reduce its width. I wonder how to do it?


EDIT:

I tried \linebreak,

\includegraphics[scale=0.45]{../0_1.eps} & 1.10 \linebreak 2.20 \linebreak 3.30 \linebreak 4.40 \\

But the result is the same as before i.e. without \linebreak.


EDIT:

I just tried what Rob suggested. But the result is not compact, because my intention is to reduce the size of the table. See the figure below:

alt text

Upvotes: 8

Views: 35366

Answers (6)

Partly Cloudy
Partly Cloudy

Reputation: 6915

Minipage might accomplish this.

\begin{minipage}{3in}
% escape the weirdness of tabular with your own mini page
1.10 \\ 2.20 \\ 3.30 \\ 4.40
\end{minipage}

You may also want a \strut on the first and last lines, to prevent it abutting any tabular borders.

Upvotes: 1

andyras
andyras

Reputation: 15910

I would look into using the multirow package. Details on spanning multiple columns/rows are here.

Upvotes: 3

Alexey Malistov
Alexey Malistov

Reputation: 26975

Try

\begin{table}   
\def\baselinestretch {}\selectfont %
% \baselineskip = 14.4pt\relax %% Uncomment this if the result is not compact.
\begin{tabular}{ | c | p{2cm} | }   
  \hline   
  $\vcenter{\hbox{\includegraphics[scale=0.45]{../0_1.eps}}$ & 
    $\vcenter{\strut 1.10\par 2.20\par 3.30\par 4.40\strut}$ \\   
  \hline    
\end{tabular}   
\end{table} 

Upvotes: 7

Charles Stewart
Charles Stewart

Reputation: 11837

You can use mathmode in the last cell: ${1.10 \atop 2.20 } \atop {3.30 \atop 4.40}$.

That will be nice and small...

If you want it bigger, cf. Typesetting fraction terms to be larger in an equation.

Upvotes: 3

Rob Hyndman
Rob Hyndman

Reputation: 31800

Try using a p column with \par to indicate line breaks.

\begin{table}  
\begin{tabular}{ | c | p{2cm} | }  
  \hline  
  \includegraphics[scale=0.45]{../0_1.eps} & 1.10\par 2.20\par 3.30\par 4.40 \\  
  \hline   
\end{tabular}  
\end{table}

Upvotes: 8

Mica
Mica

Reputation: 19617

\linebreak ? sometimes works for me in tables and sometimes doesn't.

Upvotes: 1

Related Questions