Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I currently am trying to type a table in LaTeX, such that I need not only text-wrapping in one of the cells, but also an enumerated list in one cell. Here is what I have, but the table slides off the page at present:

\begin{table}[lh]
\begin{tabular}{|c||p{3cm}|p{9cm}|c|}
\hline
& \textbf{Root Position} & \textbf{First Inversion} & \textbf{Second Inversion} \\
\hline
\textbf{Major/minor triad} & 
    \begin{enumerate}
    \item Double the Root
    \item Double the $5^{th}$ 
    \item Double the $3^{rd}$
    \end{enumerate}
&  Double any pitches \textbf{except} tendency tones (\^{4}, \& \^{7}) 
                    &  Double the $5^{th}$ \\
\hline 
Diminished triad & Double the $3^{rd}$ & Double the $3^{rd}$ & Double the $5^{th}$ \\
\hline
\end{tabular}
\end{table}

How can I prevent the 'run-off' here? Thanks.

share|improve this question
    
Some possible options: you could use resizebox from the graphicx package, or make it into a sidewaystable –  cmhughes Jul 21 '12 at 23:32
    
Your column widht specification are too large for your page - Your two p{} columns add up to 12cm!! Try {|@{}p{2.1cm}||p{2.5cm}|p{3cm}|c|@{}} and see if that is any better. –  Peter Grill Jul 22 '12 at 0:37
add comment

1 Answer

up vote 4 down vote accepted

enter image description here

You need to choose your column widths such they fit, 9cm is rather a lot. Also your MWE had an illegal table option [lh] best to use no option or [htp] if you want to allow h.

This isn't really pretty enough but it may get you started, you just need to experiment with widths, font size and \raggedright or \centering where appropriate.

\documentclass{article}



\begin{document}


\noindent X\dotfill X

\noindent X\dotfill X

\centering\small
\begin{tabular}{|p{2.2cm}||p{2.5cm}|p{2cm}|c|}
\hline
& \textbf{Root Position} & \textbf{First Inversion} & \textbf{Second Inversion} \\
\hline
\textbf{Major/minor triad} & 
\setlength\leftmargini{10pt}
    \begin{enumerate}
    \item Double the Root
    \item Double the $5^{th}$ 
    \item Double the $3^{rd}$
    \end{enumerate}
& \raggedright
 Double any pitches \textbf{except} tendency tones (\^{4}, \& \^{7}) 
                    &  Double the $5^{th}$ \\
\hline 
\centering
Diminished triad & Double the $3^{rd}$ & Double the $3^{rd}$ & Double the $5^{th}$ \\
\hline
\end{tabular}

\noindent X\dotfill X

\end{document} 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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