Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a really long table and it is out of margin. I read other post about this issue but I still cannot figure it out:

\begin{table}[htbp]
\begin{center}

\begin{tabular}{|c|c|c|p{51pt}|c|p{54pt}|c|c|}

\hline
& 
Atmosphere pressure P$_{0}$& 
Wanted pressure inside(absolute) P'& 
$\mathrm{\Delta p}$ \par & 
Altitude& 
g (m$^{2}$/s) \par & 
S (m$^{2})$& 
m (g) \\
\hline
Los Angeles& 
101.2KPa& 
180Kpa& 
78.8Kpa& 
70m& 
9.83268& 
1.26*10$^{-5}$& 
100.98 \\
\hline
Lhasa (capital of Tibet)& 
65.3KPa& 
102Kpa& 
36.7Kpa& 
3650m& 
9.82143& 
1.26*10$^{-5}$& 
47.08 \\
\hline
Mt Everest Base Camp& 
46.3KPa& 
102Kpa& 
55.7Kpa& 
5550m& 
9.81558& 
1.26*10$^{-5}$& 
71.50 \\
\hline
\end{tabular}
\label{tab3}
\end{center}
\end{table}
share|improve this question
    
have you tried the solutions from these questions: tex.stackexchange.com/questions/71419/how-to-fit-a-wide-table or tex.stackexchange.com/questions/16582/… –  ArTourter Oct 28 '13 at 16:04
4  
Welcome to TeX.SX! Please make your code compilable, starting with \documentclass{...} and ending with \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem. –  Kurt Oct 28 '13 at 16:05

2 Answers 2

You should consider using lscape and longtable packages.

lscape package allows you to use the landscape environment which rotate your table (90°). For pdf output, use pdflscape package.

And:

The longtable package defines a new environment, longtable, which has most of the features of the tabular environment, but produces tables which may be broken by TEX’s standard page-breaking algorithm.

Be careful : longtable replaces tabular environment.

Example :

\begin{landscape}
  \begin{longtable}{|c|c|c|c|c|}
    ...
  \end{longtable}
\end{landscape}

You could be also interested by these posts :

share|improve this answer

If you make your table \small, remove inessential data from it (the unit of measure can stay in the table header) and decrease a bit the intercolumn space, the table fits in the standard (345pt) text width.

\documentclass{article}
\usepackage{siunitx,booktabs}
\usepackage{caption}
\captionsetup[table]{position=top}

\begin{document}

\begin{table}
\centering\small
\addtolength{\tabcolsep}{-3pt}

\caption[Data about some places]
  {Data about some places. Notes: (1)~$P_0$ is the atmosphere pressure;
   (2)~$P'$ is the wanted pressure inside (absolute).}
\label{tab:data}

\begin{tabular}{
 l
 S[table-format=3.1]
 S[table-format=3.0]
 S[table-format=2.1]
 S[table-format=4.0]
 S[table-format=1.5]
 S[table-format=1.2e-1]
 S[table-format=3.2]
}
\toprule
& {$P_0$} & {$P'$} & {$\Delta p$} & {$A$} & {$g$} & {$S$} & {$m$} \\
& {(\si{\kilo\pascal})}
& {(\si{\kilo\pascal})}
& {(\si{\kilo\pascal})}
& {(\si[per-mode=symbol]{\meter\squared\per\second})}
& {(\si{\meter})}
& {(\si{\meter\squared})}
& {(\si{\gram})} \\
\midrule
Los Angeles             & 101.2 & 180 & 78.8 &   70 & 9.83268 & 1.26e-5 & 100.98 \\
Lhasa (capital of Tibet)&  65.3 & 102 & 36.7 & 3650 & 9.82143 & 1.26e-5 &  47.08 \\
Mt Everest Base Camp    &  46.3 & 102 & 55.7 & 5550 & 9.81558 & 1.26e-5 &  71.50 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

Note the usage of siunitx for having uniform treatment of the data and of the units (it's “kPa” rather than “KPa” or “Kpa”).

enter image description here

share|improve this answer
    
One can use \m instead of \meter; just to reduce the number of keystrokes a bit. :) –  Svend Tveskæg Oct 28 '13 at 18:17
1  
@SvendTveskæg Yes, but I believe that in this way the input is more readable. –  egreg Oct 28 '13 at 18:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.