Graphics, Figures & Tablesadjust table width to full page width

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ynovh
Posts: 1
Joined: Mon Mar 22, 2010 7:14 pm

adjust table width to full page width

Post by ynovh »

Hi all,

Recently I started working with Latex and created some beautiful tables, but now I want to create a table with same width as a page has (6.5inch). My table is too small how can I adjust the width. I tried to use p{6.5in} or specified it to each column but it didn't work.
My current table is this;

\begin{tabular}{l c c} \hline\hline
& Market Leverage & Book Leverage \\[-0.5ex]
\hline
$OverallTangibles$ &0.251***& 0.190*** \\[-1.5ex]
&(0.055) & (0.073) \\[-1.5ex]
&[25.34] &[15.15] \\[-1.5ex]
$Size$ &0.004 & 0.014 \\[-1.5ex]
&(0.006) &(0.073)\\[-1.5ex]
&[5.24] &[14.03]\\[-1.5ex]
$Profitability$ &-0.115*** &-0.118***\\[-1.5ex]
&(0.020) &(0.040)\\[-1.5ex]
&[-6.56] &[-5.30]\\[-1.5ex]
$Q$ &-0.047*** &-0.014** \\[-1.5ex]
&(0.004) &(0.007)\\[-1.5ex]
&[-17.78] &[-4.27]\\[-1.5ex]
$EarningsVolatility$ &-0.024 &-0.231 \\[-1.5ex]
&(0.067) &(0.296)\\[-1.5ex]
&[-0.79] &[-5.98]\\[-1.5ex]
$MarginalTaxRate$ & -0.158*** &-0.211***\\[-1.5ex]
&(0.027) &(0.037)\\[-1.5ex]
&[-4.26] &[-4.46]\\[-1.5ex]
$RatingDummy$ &0.044*** &0.069***\\[-1.5ex]
&(0.009) &(0.013)\\[-1.5ex]
&[0.04] &[0.07]\\[-0.5ex]
\hline
Obs. &8,645 &8,645\\[-1.5ex]
Adj.R2 &0.214 &0.088 \\[-0.5ex]
\hline\hline
\end{tabular}

Can anybody help me? Thanks in advance!

Recommended reading 2024:

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

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

adjust table width to full page width

Post by gmedina »

Hi,

seems like a job for the tabularx package: Take a look at the following example:

Code: Select all

\documentclass{article}
\usepackage{tabularx} 

\newcolumntype{A}{>{\centering\arraybackslash}X}

\begin{document}

\noindent\begin{tabularx}{\linewidth}{XAA} \hline\hline 
  & Market Leverage & Book Leverage \\[-0.5ex]
  \hline
  $OverallTangibles$ &0.251***& 0.190*** \\[-1.5ex]
  &(0.055) & (0.073) \\[-1.5ex]
  &[25.34] &[15.15] \\[-1.5ex]
  $Size$ &0.004 & 0.014 \\[-1.5ex]
  &(0.006) &(0.073)\\[-1.5ex]
  &[5.24] &[14.03]\\[-1.5ex]
  $Profitability$ &-0.115*** &-0.118***\\[-1.5ex]
  &(0.020) &(0.040)\\[-1.5ex]
  &[-6.56] &[-5.30]\\[-1.5ex]
  $Q$ &-0.047*** &-0.014** \\[-1.5ex]
  &(0.004) &(0.007)\\[-1.5ex]
  &[-17.78] &[-4.27]\\[-1.5ex]
  $EarningsVolatility$ &-0.024 &-0.231 \\[-1.5ex]
  &(0.067) &(0.296)\\[-1.5ex]
  &[-0.79] &[-5.98]\\[-1.5ex]
  $MarginalTaxRate$ & -0.158*** &-0.211***\\[-1.5ex]
  &(0.027) &(0.037)\\[-1.5ex]
  &[-4.26] &[-4.46]\\[-1.5ex]
  $RatingDummy$ &0.044*** &0.069***\\[-1.5ex]
  &(0.009) &(0.013)\\[-1.5ex]
  &[0.04] &[0.07]\\[-0.5ex]
  \hline
  Obs. &8,645 &8,645\\[-1.5ex]
  Adj.R2 &0.214 &0.088 \\[-0.5ex]
  \hline\hline 
\end{tabularx}

\end{document}
I used the horizontal spacing specifications of your example, so the rows of the table in my example will look awkward. I suppose that with your particular settings, the horizontal spacing of the rows will be fine.

Edit: on a side note, since you are interested in high quality tables, the booktabs package could be useful for you.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply