Graphics, Figures & TablesTable problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ritturaj
Posts: 2
Joined: Tue Jun 23, 2009 8:23 pm

Table problem

Post by ritturaj »

Dear All,

I an very new to Latex documentation

The table I am making is overriding the page dimension and whole table is on the one page and not shifting the table to other page when the page dimensions gets over.

Even the table is not a floating table but table starts from the new page.

\begin{table}[!ht]
\centering
\begin{tabular}{|p{0.8cm}|p{1.8cm}|p{1.5cm}|p{1.5cm}|p{2.8cm}|p{4cm}|}
.....
.....
.....

\hline
\end{tabular}
\end{table}
\clearpage

Kindly help in making the table.

I sahll be very thankful for your kind help


Wishes

Hemant

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Table problem

Post by fatra2 »

Hi there,

When you say that your table is "overriding" the page dimensions, do you mean in lenght or in width???

If your table is wider than your page, you should ajust the width of each column. To avoid having to always calculate to match the page width, why don't you use p{0.25\textwidth}.

If your table is longer than one page, then you need to use the longtable environment instead of table:

Code: Select all

\usepackage{longtable}

\begin{longtable}
and the rest the same.
\end{longtable}
Cheers
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table problem

Post by localghost »

[quote="ritturaj"][...] The table I am making is overriding the page dimension and whole table is on the one page and not shifting the table to other page when the page dimensions gets over. [...]/quote]
There are several possible solution to this issue.
  • Adapt the page dimensions by using geometry.

    Code: Select all

    \usepackage{includeheadfoot,margin=2cm]{geometry}
  • Decrease the font size of the table.

    Code: Select all

    \begin{table}[!ht]
      \centering\small
      \begin{tabular}{|p{0.8cm}|p{1.8cm}|p{1.5cm}|p{1.5cm}|p{2.8cm}|p{4cm}|}
        % table contents
      \end{tabular}
    \end{table}
  • Rotate the table by using the sidewaystable environment from rotating.

    Code: Select all

    \begin{sidewaystable}
      \centering
      \begin{tabular}{|p{0.8cm}|p{1.8cm}|p{1.5cm}|p{1.5cm}|p{2.8cm}|p{4cm}|}
        % table contents
      \end{tabular}
    \end{sidewaystable}
    Note that this environment opens a new page with the table occupying it completely.
A solution regarding tables too long for a page was introduced by fatra2. For better legibility you should avoid vertical lines in tables.



Best regards and welcome to the board
Thorsten
Post Reply