0

I am making a table in a two-column document and one of the table columns is running out of the page. This is a sample of the table. I would like to wrap the last column in the table. How can I solve this?

\begin{table}[b]

\caption{}
\label{snps.tab}%
\begin{tabular*}{\columnwidth}{@{}lllll@{}}
\toprule
SNP & Chromosome & Gene & LOD score & Annotation \\
\colrule
rs33321100 & chr17 & Srd5a2 & 3.79 & 3-oxo-5-alpha-steroid 4-dehydrogenase 2 \\
\botrule
\end{tabular*}%
\end{table}
Farhat
  • 171
  • 1
  • 1
  • 4
  • you might want to check out the array package, which provides a column format p which is "paragraph" format and the text will wrap. – FionaSmith May 22 '14 at 20:03
  • 1
    @FionaSmith p is standard latex it doesn't need any package – David Carlisle May 22 '14 at 20:13
  • @DavidCarlisle thanks! I always put in array because I wanted its other features and it mentions it in the doc so I thought it must be 'special' – FionaSmith May 22 '14 at 20:15
  • Since your table appears to be far too wide to fit in a single column of a two-column document, you may want to use the table* environment instead of the table environment. Note, though, that table* (and figure*) environments can only be placed at the top of a page. – Mico May 22 '14 at 20:19
  • 1
    @DavidCarlisle - Using a p column type since of the basic l column type may be of lower urgency to the OP. Though not mentioned explicitly by the OP, he/she faces a second, much greater problem: The tabular material is simply too wide to fit in a single column. The OP will have to use a table* environment. – Mico May 22 '14 at 20:24
  • I tried p and it results in an error for me. The document doesn't compile anymore. – Farhat May 22 '14 at 20:30
  • 1
    You probably have a missing parameter - Did you try p{width}? e.g. p{3cm} – FionaSmith May 22 '14 at 20:38
  • 1
    \begin{tabular}{ l l l l p{3.5cm} } you might need to put an mbox{} to force a line break in a good place. – FionaSmith May 22 '14 at 20:46
  • Okay, I decided to give up on trying to fit it in a single column and used table*. However, the toprule and bottom rule only extend to the first column and not the second. The text extends fine. What is to be done about them? – Farhat May 25 '14 at 20:09

0 Answers0