2

How do I make the table caption the length of the table please?

\begin{table}[ht]
\caption{Empirical Model Results}
\centering
\begin{tabular}{l c c c c} 
\hline\hline 
& \multicolumn{4}{c}{Model} \\
 & 1 & 2 & 3 & 4 \\ [0.5ex]
\hline
Interest & -3.58$^\ddagger$ & -.50 & -3.44$^\ddagger$ & -.44$^\nmid$ \\ 
 & (.37) & (.54) & (.20) & (.25)  \\[1ex]
Lagged Rainfall & -.06$^\ddagger$  & -.07$^\ddagger$ & -.01 & -.01$^\dagger$\\
 & (.009) & (.008) & (.007) & (.005) \\ [1ex]
Yearend & 3.58$^\dagger$ & 3.72$^\dagger$ & 4.23$^\ddagger$ & 4.37$^\ddagger$ \\
& (1.67) & (1.53) & (1.13) & (.91) \\[1ex]
State Fixed Effects & No & No & Yes & Yes \\[1ex]
Time Fixed Effects & No & Yes & No & Yes \\ [1ex]
$\bar{R^2}$ & .16 & .31 & .62 & .77 \\[1ex] 
\hline
\end{tabular}
 \centering 
 \caption*{
    \footnotesize Note: $\nmid$, $\dagger$ and $\ddagger$ denote significance at .1, .05 and .01 levels respectively. Standard errors presented in paratheses}
3
  • You currently have both a \caption command near the top of the table environment and a (fragmentary) \caption* command at the bottom of the table environment. Which one's supposed to be the "real" caption?
    – Mico
    Oct 2, 2014 at 5:37
  • The caption at the top is the title of the table and at the command at the bottom is like a footnote for the table. I didn't know how to do a footnote so I did it this way. I want to make the bottom caption the length of the table
    – tmhet1
    Oct 2, 2014 at 5:55
  • 1
    Welcome to TeX.SX! Please make your code compilable. It should be as short as possible but showing the whole problem. Like this, we have to guess your documentclass, the related packages and we have to type all this for you in order to help. Thank you.
    – LaRiFaRi
    Oct 2, 2014 at 7:16

2 Answers 2

2

You should use a threeparttable for such thing.

% arara: pdflatex

\documentclass{article}
\usepackage{amssymb}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{siunitx}

\begin{document}
\begin{table}[ht]
    \caption{Empirical Model Results}
    \centering
    \begin{threeparttable}
    \begin{tabular}{lcccc}\toprule
        & \multicolumn{4}{c}{Model} \\
        & 1 & 2 & 3 & 4 \\\midrule
        Interest & $-3.58^\ddagger$ & $-.50$ & $-3.44^\ddagger$ & $-.44^\nmid$ \\ 
        & $(.37)$ & $(.54)$ & $(.20)$ & $(.25)$ \\\addlinespace
        Lagged Rainfall & $-.06^\ddagger$  & $-.07^\ddagger$ & $-.01$ & $-.01^\dagger$\\
        & $(.009)$ & $(.008)$ & $(.007)$ & $(.005)$ \\\addlinespace
        Yearend & $3.58^\dagger$ & $3.72^\dagger$ & $4.23^\ddagger$ & $4.37^\ddagger$ \\
        & $(1.67)$ & $(1.53)$ & $(1.13)$ & $(.91)$ \\\addlinespace
        State Fixed Effects & No & No & Yes & Yes \\
        Time Fixed Effects & No & Yes & No & Yes \\
        $\bar{R^2}$ & $.16$ & $.31$ & $.62$ & $.77$ \\\bottomrule
    \end{tabular}
    \begin{tablenotes}
        \item[$\nmid,\dagger,\ddagger$] Significance at \numlist[add-integer-zero=false]{.1;.05;.01} levels respectively. Standard errors presented in parantheses
    \end{tablenotes}
    \end{threeparttable}
    \end{table}
\end{document}

enter image description here

1

Here's a solution that (a) uses the tabularx package to create a table with a pre-specified width (of 0.77\textwidth) and (b) uses the column specifier \multicolumn{5}{p{0.77\textwidth}} to typeset the table note. A p ("paragraph") column automatically wraps text across several lines should the need arise.

In addition, the solution uses the dcolumn package to align the numbers on their decimal markers and the booktabs package to create well-spaced horizontal lines.

enter image description here

\documentclass{article}
\usepackage{caption,amssymb,tabularx,dcolumn,booktabs}
\newcolumntype{d}[1]{D{.}{.}{#1}} % "decimal alignment" column type
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % shortcut macro
\begin{document}
\begin{table}[ht]
\caption{Empirical Model Results}
\centering
\begin{tabularx}{0.77\textwidth}{@{} X *{4}{d{2.4}} @{}} 
\toprule
& \multicolumn{4}{c@{}}{Model} \\
\cmidrule(l){2-5}
 & \mc{1} & \mc{2} & \mc{3} & \mc{4} \\
\midrule
Interest & -3.58^\ddagger & -.50 & -3.44^\ddagger & -.44^\nmid \\ 
 & (.37) & (.54) & (.20) & (.25)  \\[1ex]
Lagged Rainfall & -.06^\ddagger  & -.07^\ddagger & -.01 & -.01^\dagger\\
 & (.009) & (.008) & (.007) & (.005) \\[1ex]
Yearend & 3.58^\dagger & 3.72^\dagger & 4.23^\ddagger & 4.37^\ddagger \\
& (1.67) & (1.53) & (1.13) & (.91) \\[1ex]
State Fixed Effects & \mc{No} & \mc{No} & \mc{Yes} & \mc{Yes} \\
Time Fixed Effects & \mc{No} & \mc{Yes} & \mc{No} & \mc{Yes} \\
$\bar{R}^2$ & .16 & .31 & .62 & .77 \\ 
\midrule[\heavyrulewidth]
\multicolumn{5}{@{}p{0.77\textwidth}@{}}{\footnotesize Note: $\nmid$, $\dagger$ and $\ddagger$ denote 
significance at .1, .05 and .01 levels respectively. Standard errors presented in}\\
\end{tabularx}
\end{table}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.