I have an issue making a long list with wrapped text. The table can be several page long. I use longtable
and assign the width for each column but as soon as I put it in the \begin{table} \end{table}
, it does not work. It clips the table. I want to make a label for the table so I put it in the table environment.
And is there a way to automatically adjust the width so that I don't need to assign the value manually?
Thank you.
Tung
\begin{table}
\centering
\begin{longtable}{|p{6.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
\hline
Name & Company & Catalog Number & Comments \\ \hline
Small DNA FRAG Extract Kit-100PR & VWR & 97060-558 & \\ \hline
Acrylamide 40\% solution 500 mL & VWR & 97064-522 & \\ \hline
Bis-acrylamide 2\% (w/v) solution 500 mL & VWR & 97063-948 & \\ \hline
GeneRuler 100 bp DNA Ladder, 100-1,000 bp & Fermentas & SM0241 & \\ \hline
Mini Vertical PAGE System & VWR & 89032-300 & \\ \hline
\end{longtable}
\label{tab:list}
\end{table}
Best Answer
table
encloses its contents in a box which will not break across pages, but which can "float" to a convenient location.longtable
gets rid of this box, is able to break across pages, and does not float. Hence enclosinglongtable
inside atable
defeats the entire purpose. Removetable
environment.longtable
provides a\caption
facility and hence you can add a\label
too.A sample
For more details read the
longtable
documentation (available if you runtexdoc longtable
from command prompt/terminal or from your tex editor's help menu.Here is an improved version with better widths
And this is obligatory
booktabs
version: