10

So I basically create all my tables in Excel and then transfer to Texnic Center by using the Excel2LaTeX addin for Excel. I am not too familiar with adjusting the outputted code to my own likings. For example, I have the following table (directly from Excel2LaTeX):

\begin{table}[htbp] \centering \caption{Add caption} \begin{tabular}{ccccccc} \toprule Dependent variable: & $CoJPoD_{system|sov}$ & & $\Delta$$CoJPoD_{system|sov}$ & & $CoJPoD_{sov|system}$ & \\ \midrule & & & & & & \\ & \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 \\ \bottomrule \end{tabular} \label{tab:addlabel} \end{table} 

Basically, the table is too wide to fit onto a portrait page (I do not want to use landscape). I see that there is quite a wide gap between each column, is there a way for me to reduce the gap between columns?

Thanks.

2 Answers 2

15

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} 
2
  • 17
    This does adjust the width but also makes all my columns left justified. Is there a way to adjust the width but still centre justify? Commented Oct 14, 2016 at 14:02
  • 1
    I also want to know about the last comment :-) Commented Jan 2, 2023 at 15:11
1

For guys looking for center align while shrinking margins, add:

\usepackage{array} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \begin{table} \begin{tabular}{C{1cm}C{1cm}} test for this & test for this \end{tabular} \end{table} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.