1

I have the following table. I would like to put a caption on it with title and number of the the table. I don't manage to do so. This is my code:

\begin{center}
\begin{tabular}{lr}
\toprule
\label{tab: first}
  & $Hawkish$\\
\midrule
budget balance & $-0.21$\\
rebuild fiscal buffer &  $-0.71$\\
fiscal consolidation &  $-0.93$\\
get their house in order & $-0.22$\\
avoid any procyclical bias & $-0.21$\\
expenditure restraint & $-0.75$\\
budget retrenchment & $-0.21$\\
no case for fiscal activism  & $-0.21$\\
debt sustainability & $-0.70$\\
deficit reduction & $-0.82$\\
structural adjustment & $-0.82$\\
\bottomrule
\end{tabular}
\begin{tabular}{lr}
\toprule
  & $Dovish$\\
\midrule
domestic demand & $0.75$\\
fiscal space & $0.84$\\
government expenditure & $0.53$\\
job creation & $0.18$\\
flexibility & $0.24$\\
automatic stabiliser & $0.51$\\
public investment & $0.91$\\
public sector & $0.54$\\
fiscal union & $0.68$\\
growth friendly & $0.71$\\
ease social hardship & $0.86$\\
\bottomrule
\end{tabular}
\end{center}

Can anyone help me?

Thanks!

1
  • How is this related to the beamer documentclass?
    – leandriis
    Apr 26, 2020 at 14:04

1 Answer 1

2

enter image description here

\documentclass{article}
\usepackage{booktabs, caption}

\begin{document}

\begin{table}

\centering
    \caption{caption above table}
\begin{tabular}{lr}
\toprule
\label{tab: first}
  & $Hawkish$\\
\midrule
budget balance & $-0.21$\\
rebuild fiscal buffer &  $-0.71$\\
fiscal consolidation &  $-0.93$\\
get their house in order & $-0.22$\\
avoid any procyclical bias & $-0.21$\\
expenditure restraint & $-0.75$\\
budget retrenchment & $-0.21$\\
no case for fiscal activism  & $-0.21$\\
debt sustainability & $-0.70$\\
deficit reduction & $-0.82$\\
structural adjustment & $-0.82$\\
\bottomrule
\end{tabular}
\begin{tabular}{lr}
\toprule
  & $Dovish$\\
\midrule
domestic demand & $0.75$\\
fiscal space & $0.84$\\
government expenditure & $0.53$\\
job creation & $0.18$\\
flexibility & $0.24$\\
automatic stabiliser & $0.51$\\
public investment & $0.91$\\
public sector & $0.54$\\
fiscal union & $0.68$\\
growth friendly & $0.71$\\
ease social hardship & $0.86$\\
\bottomrule
\end{tabular}
\caption{caption below table}

\end{table}



\textbf{
or minipage environment if you dont want the table to float \\ [1cm] 
}


\begin{minipage}{\linewidth}
    \centering
    \captionof{table}{Table Title} \label{tab:title} 
\begin{tabular}{lr}
    \toprule
    & $Dovish$\\
    \midrule
    domestic demand & $0.75$\\
    fiscal space & $0.84$\\
    government expenditure & $0.53$\\
    job creation & $0.18$\\
    flexibility & $0.24$\\
    automatic stabiliser & $0.51$\\
    public investment & $0.91$\\
    public sector & $0.54$\\
    fiscal union & $0.68$\\
    growth friendly & $0.71$\\
    ease social hardship & $0.86$\\
    \bottomrule
\end{tabular}\par
        \bigskip
        Should be a caption
    \end{minipage}
\end{document}
1
  • thank you very much!
    – Rollo99
    Apr 24, 2020 at 10:06

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.