0

I created the following table:

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\titleformat{\chapter}
  {\normalfont\huge\bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\usepackage{appendix}
\usepackage[a4paper, left=30mm, right=30mm, top=25mm, bottom=25mm]{geometry}

\counterwithout{table}{chapter} \begin{table}[ht] \centering \small \renewcommand{\arraystretch}{1.4} \caption{Descriptive statistics for the daily return of the timeseries.} \label{tab:title} \begin{tabular}{\linewidth}{@{\extracolsep{\fill}}ll S[table-format=-2.3]l S[table-format=-2.3]l S[table-format=-2.3] S[table-format=3.3] l[table-format=3.3] {9}{S[table-format=-2.3]}@{} } \toprule & {Obs.} & {Mean} & {Std.Dev} & {Min} & {Max} & {Skewness} & {Kurtosis} & {Jarque Bera}\ \hline USDT & 1569 & 0.000 & 0.005 & -0.056 & 0.046 & 0.205 & 27.409 & 2.200e-16 \ PAX & 706 & 0.000 & 0.010 & -0.108 & 0.118 & 1.040 & 65.617 & 2.200e-16\ DGX & 813 & 0.001 & 0.045 & -0.349 & 0.564 & 2.626 & 44.129 & 2.200e-16\ PAXG & 626 & 0.000 & 0.014 & -0.172 & 0.080 & -3.602 & 45.440 & 2.200e-16\ DAI & 596 & 0.000 & 0.005 & -0.042 & 0.045 & 0.058 & 37.134 & 2.200e-16\ WBTC & 405 & 0.007 & 0.097 & -0.356 & 0.370 & 0.475 & 2.301 & 2.200e-16\ AMPL & 743 & 0.004 & 0.116 & -0.723 & 1.090 & 1.351 & 15.358 & 2.200e-16\ BTC & 1657 & 0.003 & 0.043 & -0.389 & 0.264 & -0.162 & 6.484 & 2.200e-16\ LTC & 928 & 0.003 & 0.057 & -0.381 & 0.296 & -0.080 & 7.069 & 2.200e-16\ EUR & 1161 & 0.000 & 0.004 & -0.028 & 0.015 & -0.155 & 2.137 & 2.200e-16\ JPY & 1161 & 0.000 & 0.004 & -0.026 & 0.022 & 0.001 & 2.865 & 2.200e-16\ \hline \end{tabular*} \end{table}

Unfortunately it does not fit nicely on my page (it's a little too wide). I played around a lot but I can't seem to make it look ok. I have the same issue with another table... Can someone help me? Thank you!

Bernard
  • 271,350
Nina
  • 35
  • Thanks! Yes, for the most part it does. But I still have the problem that sometimes I have a rather large space between my columns and also the the \topline values are not in the center of the columns...

    Also, it does not work for my Second table... I just edited my question and added the second table I have problems with.

    – Nina Jul 23 '21 at 19:18
  • 1
    There are several errors in the code you posted. The siunitx and booktabs packages are missing in the preamble and l[table-format=3.3] should probably be S[table-format=3.3]. Fix these error before worrying about the "output". You also declare a total of 18 columns, but you only really use 9 of them. Also, the table-format options of some of your columns don't match their contents. Once corrected, your table should fit into the available space. – leandriis Jul 23 '21 at 19:20

1 Answers1

1

Here is a corrected version of your table:

enter image description here

\documentclass[12pt]{report}
\usepackage[a4paper, left=30mm, right=30mm, top=25mm, bottom=25mm]{geometry}

\usepackage{siunitx} \usepackage{booktabs}

\begin{document} \begin{table}[ht] \centering \small \renewcommand{\arraystretch}{1.4} \caption{Descriptive statistics for the daily return of the timeseries.} \label{tab:title} \begin{tabular}{\linewidth}{@{\extracolsep{\fill}} l S[table-format=4] S[table-format=1.3] S[table-format=1.3] S[table-format=-1.3] S[table-format=1.3] S[table-format=-1.3] S[table-format=2.3] S[table-format=1.3e-2] @{} } \toprule & {Obs.} & {Mean} & {Std.Dev} & {Min} & {Max} & {Skewness} & {Kurtosis} & {Jarque Bera}\ \midrule USDT & 1569 & 0.000 & 0.005 & -0.056 & 0.046 & 0.205 & 27.409 & 2.200e-16 \ PAX & 706 & 0.000 & 0.010 & -0.108 & 0.118 & 1.040 & 65.617 & 2.200e-16\ DGX & 813 & 0.001 & 0.045 & -0.349 & 0.564 & 2.626 & 44.129 & 2.200e-16\ PAXG & 626 & 0.000 & 0.014 & -0.172 & 0.080 & -3.602 & 45.440 & 2.200e-16\ DAI & 596 & 0.000 & 0.005 & -0.042 & 0.045 & 0.058 & 37.134 & 2.200e-16\ WBTC & 405 & 0.007 & 0.097 & -0.356 & 0.370 & 0.475 & 2.301 & 2.200e-16\ AMPL & 743 & 0.004 & 0.116 & -0.723 & 1.090 & 1.351 & 15.358 & 2.200e-16\ BTC & 1657 & 0.003 & 0.043 & -0.389 & 0.264 & -0.162 & 6.484 & 2.200e-16\ LTC & 928 & 0.003 & 0.057 & -0.381 & 0.296 & -0.080 & 7.069 & 2.200e-16\ EUR & 1161 & 0.000 & 0.004 & -0.028 & 0.015 & -0.155 & 2.137 & 2.200e-16\ JPY & 1161 & 0.000 & 0.004 & -0.026 & 0.022 & 0.001 & 2.865 & 2.200e-16\ \bottomrule \end{tabular} \end{table} \end{document}

leandriis
  • 62,593