0

I want to create a footnote within a table environment, when I use the regular \footnote then the text will not be shown on the bottom of the page. If I use \tablefootnote it will be shown on the first page and my table is shown on the second page. But I want them to appear on the same page. How can I achieve that? - Also how can I make the caption to be left-aligned?

Thanks a lot,

Julia

This is my code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{dcolumn,tabularx,ragged2e}
\usepackage{siunitx}
\usepackage{tablefootnote}
\begin{document}

\begin{table}[htbp]
   \centering
  \caption{Descriptives Table}
    \begin{tabular}{lll}
      \textbf{}&\textbf{Mean(SE) or Prop. in \%\tablefootnote{These values were calculated using weighted and imputed data.}} & \textbf{Range} \\
      \toprule
\textbf{x} & 3.157  (0.044) & {0-12} \\
\textbf{Life x} & 7.281 (0.035) &{0-12} \\
\textbf{x} & 62.2\%  &  \\
\textbf{x} & 33.571 (0.156) & {18-83} \\
\textbf{Overall x} & 3.909 (0.017) & 30-4 \\
\textbf{Low x} & 61.8\%  &  \\
\textbf{Medium x} & 21.1\%    &  \\
\textbf{High x} & 17.1\%    &  \\
\textbf{x} & 24.56 (0.058) & 3-24 \\
\textbf{x-x} & 6.264 (0.018) & 30-6 \\
\textbf{Time in x} & 1.687 (0.02) & {1 mo - 32 yrs} \\
\textbf{Status x x x} & 51.7\%  &  \\
\textbf{Status x} & 4.5\%    &  \\
\textbf{Status x x x.} & 3.7\%    &  \\
\textbf{Status x x} & 34.6\%  &  \\
\textbf{Status x x} & 5.4\%    &  \\
\textbf{Not x} & 90.7\%  &  \\
\textbf{x x x } & 9.3\%    &  \\
\textbf{x x} & 33.5\%  &  \\
\textbf{x x w/ other x} & 32.4\%  &  \\
\textbf{x x w/o other x} & 34.1\%  &  \\
\textbf{x not in x} & 94.5\%  &  \\
\textbf{x in x} & 94.4\%    &  \\
\textbf{x not x} & 81.6\%  &  \\
\textbf{x x} & 10.7\%    &  \\
\textbf{x x x} & 7.7\%    &  \\
\textbf{x of x courses x} & 0.843 (0.01) & {0-5} \\
\textbf{Time with others from country o. origin} & 3.847 (0.028) & 31-5 \\
\textbf{Time x x} & 3.661 (0.028) & 31-5 \\
\textbf{Time x x x x x. } & 2.871 (0.029) & 31-5 \\
\textbf{x lang. x} & 2.582 (0.015) & 30-4 \\
\textbf{No x x x} & 74.2\%  &  \\
\textbf{x x x} & 25.8\%    &  \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}
\end{document}
1
3

You are telling your table that it's allowed to go to the next page by using the [htbp] This means it's allowed to go ([h]ere, [t]op, [b]ottom or on it's own special figures-[p]age). However, if you change it to [h!] (here!) then it works as expected. Sharelatex has a good introduction to float specifiers, as they're called. Below is the working example you gave. Just with the [h!] instead of [htbp].

Note that the reason it wants to move it to the next page is probably because the table is very long, and doesn't really fit on the page. So a heads up: we're forcing it to fit on the page!

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{dcolumn,tabularx,ragged2e}
\usepackage{siunitx}
\usepackage{tablefootnote}
\begin{document}

\begin{table}[h!]
   \centering
  \caption{Descriptives Table}
    \begin{tabular}{lll}
      \textbf{}&\textbf{Mean(SE) or Prop. in \%\tablefootnote{These values were calculated using weighted and imputed data.}} & \textbf{Range} \\
      \toprule
\textbf{x} & 3.157  (0.044) & {0-12} \\
\textbf{Life x} & 7.281 (0.035) &{0-12} \\
\textbf{x} & 62.2\%  &  \\
\textbf{x} & 33.571 (0.156) & {18-83} \\
\textbf{Overall x} & 3.909 (0.017) & 30-4 \\
\textbf{Low x} & 61.8\%  &  \\
\textbf{Medium x} & 21.1\%    &  \\
\textbf{High x} & 17.1\%    &  \\
\textbf{x} & 24.56 (0.058) & 3-24 \\
\textbf{x-x} & 6.264 (0.018) & 30-6 \\
\textbf{Time in x} & 1.687 (0.02) & {1 mo - 32 yrs} \\
\textbf{Status x x x} & 51.7\%  &  \\
\textbf{Status x} & 4.5\%    &  \\
\textbf{Status x x x.} & 3.7\%    &  \\
\textbf{Status x x} & 34.6\%  &  \\
\textbf{Status x x} & 5.4\%    &  \\
\textbf{Not x} & 90.7\%  &  \\
\textbf{x x x } & 9.3\%    &  \\
\textbf{x x} & 33.5\%  &  \\
\textbf{x x w/ other x} & 32.4\%  &  \\
\textbf{x x w/o other x} & 34.1\%  &  \\
\textbf{x not in x} & 94.5\%  &  \\
\textbf{x in x} & 94.4\%    &  \\
\textbf{x not x} & 81.6\%  &  \\
\textbf{x x} & 10.7\%    &  \\
\textbf{x x x} & 7.7\%    &  \\
\textbf{x of x courses x} & 0.843 (0.01) & {0-5} \\
\textbf{Time with others from country o. origin} & 3.847 (0.028) & 31-5 \\
\textbf{Time x x} & 3.661 (0.028) & 31-5 \\
\textbf{Time x x x x x. } & 2.871 (0.029) & 31-5 \\
\textbf{x lang. x} & 2.582 (0.015) & 30-4 \\
\textbf{No x x x} & 74.2\%  &  \\
\textbf{x x x} & 25.8\%    &  \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}
\end{document}
1
  • This solution works very well, thanks a lot. Jun 19 at 19:11
3

mostly of topic (solution is already known). i would slightly redesign your table:

\documentclass{article}
\usepackage{geometry}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{makecell}                         % new
\renewcommand\theadfont{\bfseries\normalsize} % new
\renewcommand\theadgape{}                     % new
\usepackage{dcolumn,tabularx,ragged2e}
\usepackage{siunitx}
\usepackage{tablefootnote}

\begin{document}
   \begin{table}[!htp]
   \centering
  \caption{Descriptives Table}
    \begin{tabular}{>{\bfseries}l                              % changed
                                S[table-format=2.3,
                                  table-align-text-post=false] % changed
                                S[input-symbols = {( - )},
                                  table-format=1.3]            % changed
                                c}                             % changed
      \toprule
                & \multicolumn{2}{c}{\thead{Mean(SE)\\ or Prop. in \%\tablefootnote{These values were calculated using weighted and imputed data.}}}
                                        & \thead{Range} \\         % changed
      \midrule
x               & 3.157     & (0.044)   & {0-12}    \\
Life x          & 7.281     & (0.035)   & {0-12}    \\
x               & 62.2\,\%    &           &           \\
x               & 33.571    & (0.156)   & {18-83} \\
Overall x       & 3.909     & (0.017)   & 30-4 \\
Low x           & 61.8\,\%                &  \\
Medium x        & 21.1\,\%                &  \\
High x          & 17.1\,\%                &  \\
x               & 24.56     & (0.058) & 3-24 \\
x-x             & 6.264     & (0.018) & 30-6 \\
Time in x       & 1.687     & (0.02)    & {1 mo - 32 yrs} \\
Status x x x    & 51.7\,\%    &           &  \\
Status x        & 4.5\,\%     &           &   \\
Status x x x.   & 3.7\,\%     &           &  \\
Status x x      & 34.6\,\%    &           &  \\
Status x x      & 5.4\,\%     &           &  \\
Not x           & 90.7\,\%    &           &  \\
x x x           & 9.3\,\%     &           &  \\
x x             & 33.5\,\%    &           &  \\
x x w/ other x  & 32.4\,\%    &           &  \\
x x w/o other x & 34.1\,\%    &           &  \\
x not in x      & 94.5\,\%    &           &  \\
x in x          & 94.4\,\%    &           &  \\
x not x         & 81.6\,\%    &           &  \\
x x             & 10.7\,\%    &           &  \\
x x x           & 7.7\,\%     &           &  \\
x of x courses x    & 0.843 & (0.01)    & {0-5} \\
Time with others from country o. origin
                & 3.847     & (0.028)   & 31-5 \\
Time x x        & 3.661     & (0.028)   & 31-5 \\
Time x x x x x.   & 2.871   & (0.029)   & 31-5 \\
x lang. x       & 2.582     & (0.015)   & 30-4 \\
No x x x        & 74.2\,\%    &           &  \\
x x x           & 25.8\,\%    &           &  \\
    \bottomrule
\end{tabular}%
\label{tab:addlabel}%
    \end{table}
\end{document}

enter image description here

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.