I wrote a table that turned out to be too wide. So I have to turn it sideways for it to fit a typical journal paper. Is there a way I can avoid typing it all over again?!
[Tex/LaTex] Is it possible to exchange rows and columns of a table without retyping
tables
Related Solutions
use p{1.5cm}
instead of c
. Adjust the width as per your requirement. You can also tune gap between two columns if required.
\begin{tabular}{p{2cm} p{2cm}p{2cm}p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}}
Your Table
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\title{Your Paper}
\author{You}
\begin{document}
\maketitle
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{p{2cm} p{2cm}p{2cm}p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}}
Dependent variable: & $CoJPoD_{system|sov}$ & & $\Delta$$CoJPoD_{system|sov}$ & & $CoJPoD_{sov|system}$ & \\
& & & & & & \\
& \textbf{(1)} & \textbf{(2)} & \textbf{(3)} & \textbf{(4)} & \textbf{(5)} & \textbf{(6)} \\
& & & & & & \\
Constant & -11.116*** & -10.045*** & -6.668*** & -5.597*** & 13.194*** & 13.938*** \\
& (-2.934) & (-3.540) & (-2.939) & (-3.000) & (3.584) & (3.556) \\
Market Ret (6 months) (\%) & 0.001*** & & 0.001*** & & 0.000 & \\
& (3.022) & & (3.645) & & (-0.016) & \\
Market Vol (6 months) (\%) & 0.008 & & 0.009 & & 0.008 & \\
& (0.686) & & (1.127) & & (0.458) & \\
Market Ret (1 month) (\%) & & 0.013** & & 0.010** & & -0.021*** \\
& & (2.010) & & (2.171) & & (-2.723) \\
Market Vol (1 month) (\%) & & -1.949*** & & -1.629*** & & -0.051 \\
& & (-4.682) & & (-5.221) & & (-0.063) \\
Log GDP & 0.913*** & 0.826*** & 0.550*** & 0.463*** & -1.180*** & -1.242*** \\
& (2.882) & (3.470) & (2.919) & (2.943) & (-3.824) & (-3.764) \\
Debt/GDP (\%) & 0.004*** & 0.004*** & 0.002* & 0.002 & 0.004* & 0.004* \\
& (2.796) & (2.825) & (1.953) & (1.949) & (1.750) & (1.730) \\
Reserve/Debt (\%) & 0.0689** & 0.071** & 0.043** & 0.045* & 0.075** & 0.072** \\
& (2.478) & (2.322) & (2.101) & (1.919) & (2.371) & (2.325) \\
Term Spread (\%) & 0.0423*** & 0.041*** & 0.038*** & 0.037*** & 0.012 & 0.015** \\
& (6.244) & (6.984) & (7.033) & (7.261) & (1.312) & (2.154) \\
VSTOXX (\%) & 0.004*** & 0.003*** & 0.003*** & 0.002*** & 0.008*** & 0.007868*** \\
& (4.853) & (4.192) & (4.389) & (3.737) & (7.545) & (7.848) \\
& & & & & & \\
Bank fixed effects & Yes & Yes & Yes & Yes & Yes & Yes \\
No. of observations & 620 & 620 & 620 & 620 & 620 & 620 \\
Adjusted $R^2$ & 0.728 & 0.719 & 0.774 & 0.760 & 0.822 & 0.822 \\
\end{tabular}
\label{tab:addlabel}
\end{table}
\end{document}
Best Answer
Like John Kormylo said,
pgfplotstable
can be a convenient way to do this.I'm not a expert, but in my test's I understand that's need to stay alert about spaces.
In
\pgfplotstableread
you will enter you source table. Into the final of this command, you will name this source; in this case is\tablesource
.In
\pgfplotstabletranspose
you will finish with tha name of transposed table;\tabletransp
.The command
\pgfplotstabletypeset
will call what you put into brackets.