I am just learning how to use LaTex so please excuse my newbie question. I am trying to create a table, that I exported from excel and everything works except that my titles for the columns are too long so that they do not fit the page. I tried the p{3cm}
code and also \textwidth
but neither of them work. Every tip would be very much appreciated.
Also a general question: what is [htbp]
in \begin{table}[htbp]
for?
This is my code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\begin{document}
\begin{table}[htbp]
\centering
\setlength{\tabcolsep}{0.75cm}
\caption{Descriptive Table}
\begin{tabular}{lrr}
\toprule
Variable & \multicolumn{1}{l}{Imputed and Weighted Means} & \multicolumn{1}{l}{Standard deviation} \\
\midrule
Distress & 3.18 & 0.04 \\
Life satisfaction & 7.27 & 0.04 \\
Age & 0 & 0.01 \\
Health & 0 & 0.01 \\
Resilience & 3.67 & 0.13 \\
Self esteem & -0.01 & 0.02 \\
Arrger & 0.01 & 0.02 \\
Course participation & 0.01 & 0.02 \\
Time countor & 0 & 0.01 \\
Time ger & 0 & 0.01 \\
Time oth & 0 & 0.01 \\
Meanger & 0 & 0.01 \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
\end{document}