Is there a definitive way to add table notes to an xtable that will wrap if the tablenote is longer than the width of the table? I have referenced this question here which proposes splitting long table notes into multiple lines and adding it to add.to.row.
argument. Is there a way to avoid doing that and have it wrap automatically?
If I was using Latex only, I would use \usepackage{threeparttable}[flushleft]
and use the code below. However, I do not believe you can add the \end{tabular}
line with the add.to.row
arguement.
Thanks in advance!
\documentclass{article}
\usepackage{threeparttable}[flushleft]
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\caption{Here is a caption}
\begin{threeparttable}
\begin{tabular}{lll}
\toprule
Entry A\tnote{1} & Entry B & Entry C \\
Entry D\tnote{2} & Entry E & Entry F \\
Entry G & Entry H & Entry I \\
\bottomrule
\end{tabular}%
\begin{tablenotes}
\item[1] Here is my first note.
\item[2] And here is my second note.
\end{tablenotes}
\end{threeparttable}
\label{tab:table}%
\end{table}%
\end{document}