1

I am having problems with a longtable, it goes off the side of the page and any attempt to limit the width only seems to work on the first page. Here is a cut down version of my table

% Appendix B
\chapter{Elelments for the MetDB Retrieval}
\label{AppendixB}
\lhead{Appendix B. \emph{Elelments for the MetDB Retrieval}}
\chapter{Elelments for the MetDB Retrieval}
\label{AppendixB}
\lhead{Appendix B. \emph{Elelments for the MetDB Retrieval}}

\begin{center}
\begin{longtable}{|c|c|c|} %try definind the width here
\hline
\textbf{Element Name} & \textbf{Element Description} & \textbf{Units} \\
\hline
\endfirsthead
\hline
\textbf{Element Name} & \textbf{Element Description} & \textbf{Units} \\
\hline
\endhead
\hline

table entries...

\hline
%\end{tabular}
\caption{Elelments for the metDB retrieval}
\end{longtable}
\end{center}

Here is an image:

enter image description here

Any help on this subject would be nice!

1
  • Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Jul 26, 2012 at 18:14

2 Answers 2

6

Add

 \usepackage{array}

then you may use an extended preamble syntax.

Then replace

\begin{longtable}{|c|c|c|}

by

\begin{longtable}{|*{3}{>{\centering\arraybackslash}p{3cm}|}}

for 3 3cm wide columns, adjust the width to taste.

2

AFAIK, you cannot limit or otherwise specify the width of centered columns. You have to use justified columns (that is, "p") to accomplish this, as in "p{3cm}".

See also here.

You must log in to answer this question.