Graphics, Figures & TablesMy table is out of border of pager

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

My table is out of border of pager

Post by yaozhao »

My table is out of border of pager. How should I do? I already rotate it, but it's still out of the page.

Code: Select all

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{rotating}

\begin{document}

\begin{sidewaystable}
    \centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Regression table\label{tab1}}
\begin{tabular}{l*{17}{D{.}{.}{-1}}}
\toprule
                    &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}&\multicolumn{1}{c}{(6)}&\multicolumn{1}{c}{(7)}&\multicolumn{1}{c}{(8)}&\multicolumn{1}{c}{(9)}&\multicolumn{1}{c}{(10)}&\multicolumn{1}{c}{(11)}&\multicolumn{1}{c}{(12)}&\multicolumn{1}{c}{(13)}&\multicolumn{1}{c}{(14)}&\multicolumn{1}{c}{(15)}&\multicolumn{1}{c}{(16)}&\multicolumn{1}{c}{(17)}\\
                    &\multicolumn{1}{c}{facebook}&\multicolumn{1}{c}{facebook}&\multicolumn{1}{c}{instagram}&\multicolumn{1}{c}{twitter}&\multicolumn{1}{c}{snapchat}&\multicolumn{1}{c}{pinterest}&\multicolumn{1}{c}{tiktok}&\multicolumn{1}{c}{linkedin}&\multicolumn{1}{c}{strava}&\multicolumn{1}{c}{facebook}&\multicolumn{1}{c}{instagram}&\multicolumn{1}{c}{twitter}&\multicolumn{1}{c}{snapchat}&\multicolumn{1}{c}{pinterest}&\multicolumn{1}{c}{tiktok}&\multicolumn{1}{c}{linkedin}&\multicolumn{1}{c}{strava}\\
\midrule
age26\_35            &      -0.212   &      -0.212   &      -0.397*  &      -0.364   &      -0.723***&      -0.432*  &      -0.344   &       0.870***&       0.162   &      -0.212   &      -0.397*  &      -0.364   &      -0.723***&      -0.432*  &      -0.344   &       0.870***&       0.162   \\
                    &     (-1.09)   &     (-1.09)   &     (-1.76)   &     (-1.45)   &     (-2.82)   &     (-1.84)   &     (-1.36)   &      (3.19)   &      (0.91)   &     (-1.09)   &     (-1.76)   &     (-1.45)   &     (-2.82)   &     (-1.84)   &     (-1.36)   &      (3.19)   &      (0.91)   \\
\addlinespace
Q2\_Gender           &       0.436** &       0.436** &       0.269   &      -0.510** &       0.404*  &       1.519***&     -0.0219   &      0.0359   &      -0.246   &       0.436** &       0.269   &      -0.510** &       0.404*  &       1.519***&     -0.0219   &      0.0359   &      -0.246   \\
                    &      (2.38)   &      (2.38)   &      (1.27)   &     (-2.16)   &      (1.68)   &      (6.89)   &     (-0.09)   &      (0.14)   &     (-1.47)   &      (2.38)   &      (1.27)   &     (-2.16)   &      (1.68)   &      (6.89)   &     (-0.09)   &      (0.14)   &     (-1.47)   \\
\addlinespace
Q16\_Income          &       0.134*  &       0.134*  &      0.0775   &       0.141   &     0.00248   &    -0.00814   &      -0.156*  &       0.364***&      0.0589   &       0.134*  &      0.0775   &       0.141   &     0.00248   &    -0.00814   &      -0.156*  &       0.364***&      0.0589   \\
                    &      (1.84)   &      (1.84)   &      (0.92)   &      (1.51)   &      (0.03)   &     (-0.09)   &     (-1.66)   &      (3.58)   &      (0.88)   &      (1.84)   &      (0.92)   &      (1.51)   &      (0.03)   &     (-0.09)   &     (-1.66)   &      (3.58)   &      (0.88)   \\
\addlinespace
Q17\_Neighborhood    &    -0.00897   &    -0.00897   &       0.226   &      -0.147   &      0.0527   &       0.136   &    -0.00378   &       0.225   &     -0.0510   &    -0.00897   &       0.226   &      -0.147   &      0.0527   &       0.136   &    -0.00378   &       0.225   &     -0.0510   \\
                    &     (-0.07)   &     (-0.07)   &      (1.48)   &     (-0.87)   &      (0.30)   &      (0.85)   &     (-0.02)   &      (1.22)   &     (-0.42)   &     (-0.07)   &      (1.48)   &     (-0.87)   &      (0.30)   &      (0.85)   &     (-0.02)   &      (1.22)   &     (-0.42)   \\
\addlinespace
relationship        &       0.309   &       0.309   &     -0.0827   &      -0.405   &     -0.0124   &       0.956***&      -0.397   &      -0.412   &      0.0585   &       0.309   &     -0.0827   &      -0.405   &     -0.0124   &       0.956***&      -0.397   &      -0.412   &      0.0585   \\
                    &      (1.58)   &      (1.58)   &     (-0.36)   &     (-1.61)   &     (-0.05)   &      (4.06)   &     (-1.56)   &     (-1.50)   &      (0.33)   &      (1.58)   &     (-0.36)   &     (-1.61)   &     (-0.05)   &      (4.06)   &     (-1.56)   &     (-1.50)   &      (0.33)   \\
\addlinespace
Constant            &       4.186***&       4.186***&       4.018***&       4.638***&       4.079***&       2.742***&       3.870***&       2.028***&       1.446***&       4.186***&       4.018***&       4.638***&       4.079***&       2.742***&       3.870***&       2.028***&       1.446***\\
                    &     (11.15)   &     (11.15)   &      (9.24)   &      (9.58)   &      (8.25)   &      (6.06)   &      (7.92)   &      (3.85)   &      (4.20)   &     (11.15)   &      (9.24)   &      (9.58)   &      (8.25)   &      (6.06)   &      (7.92)   &      (3.85)   &      (4.20)   \\
\midrule
Observations        &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   &         193   \\
\bottomrule
\multicolumn{18}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{18}{l}{\footnotesize * $p<0.10, ** p<0.05, *** p<0.01$}\\
\end{tabular}
\end{sidewaystable}


\end{document}

Recommended reading 2024:

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

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

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

My table is out of border of pager

Post by Bartman »

Even if you significantly reduce the font size and the space between the columns, the table is still too big.

Why don't you swap the labels in the first column with those in the first row? So you can e.g. use the longtable environment in portrait mode, if one page is not enough.

For the markings of the table contents and their labeling at the end of the table, you should take a look at the package threeparttable.
Post Reply