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 enclosing longtable
inside a table
defeats the entire purpose. Remove table
environment.
longtable
provides a \caption
facility and hence you can add a \label
too.
A sample
\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}{|p{6.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
\caption[An optional table caption]{A long table\label{tab:list}}\\
\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}
A long table~\ref{tab:list} is here.
\end{document}
For more details read the longtable
documentation (available if you run texdoc longtable
from command prompt/terminal or from your tex editor's help menu.
Here is an improved version with better widths
\documentclass{article}
\usepackage{longtable,array,showframe} %% Remove showframe
\begin{document}
\begin{longtable}{|>{\raggedright}m{0.4\textwidth}|
>{\raggedright}p{0.13\textwidth}|
>{\raggedright}p{0.15\textwidth}|
>{\raggedright\arraybackslash}p{0.13\textwidth}|}
\caption[An optional table caption]{A long table\label{tab:list}}\\
\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}
A long table~\ref{tab:list} is here.
\end{document}
And this is obligatory booktabs
version:
\documentclass{article}
\usepackage{longtable,array,booktabs,showframe}
\begin{document}
\begin{longtable}{>{\raggedright}m{0.4\textwidth}
>{\raggedright}p{0.13\textwidth}
>{\raggedright}p{0.15\textwidth}
>{\raggedright\arraybackslash}p{0.13\textwidth}}
\caption[An optional table caption]{A long table\label{tab:list}}\\
\toprule
Name & Company & Catalog Number & Comments \\ \midrule
Small DNA FRAG Extract Kit-100PR & VWR & 97060-558 & \\
Acrylamide 40\% solution 500 mL & VWR & 97064-522 & \\
Bis-acrylamide 2\% (w/v) solution 500 mL & VWR & 97063-948 & \\
GeneRuler 100 bp DNA Ladder, 100-1,000 bp & Fermentas & SM0241 & \\
Mini Vertical PAGE System & VWR & 89032-300 & \\ \bottomrule
\end{longtable}
A long table~\ref{tab:list} is here.
\end{document}
lontable
provides caption too.