Multiple references to the same footnote within a table

footnotes

I am referencing the same footnote multiple times within a table. I have been able to use this answer to reference the same footnote in multiple spots:
Multiple references to the same footnote with hyperref support – is there a better solution?

Now I am stuck as to how to get rid of the references to the footnotes which reappear before my text (after the table). Here is my example:

\documentclass[12pt]{article}
\usepackage{footmisc}

\begin{document}
\begin{table}[!htb]
    \centering
    \begin{tabular}{lll}
    & col1 & col2\\\hline
    row1 & val11\footref{fn:note1} & val12\\
    row2 & val21\footref{fn:note1} & val22\footref{fn:note2}\\
\end{tabular}   \caption{Caption for table.}
\end{table}
\footnote{\label{fn:note1}First note}
\footnote{\label{fn:note2}Second note}
I do not want my text to be preceded by the superscripts 1 and 2 referencing the footnotes from the table.
\end{document}

This yields the following, which has the unwanted superscripts 1 2 right before my text:
enter image description here

How can I get rid of these unwanted superscripts (the extra ones)? Thanks!

Best Answer

The tools of the threeparttable package are great for tables that contain repeated footnotes. The footnote markers -- inserted via \tnote directives needn't be numbers; the arguments of the \tnote directives can be numerals, letters, or just about any other symbol, and they don't have to occur in any particular order; your readers, though, might appreciate if you do impose some order...

Formally, a threeparttable environments has three parts (hence the name): a tabular-like environment (could also be tabular* or tabularx), a tablenotes environment, and a \caption directive. The code automatically limits the widths of parts 2 and 3 to that of the tabular-like environment.

enter image description here

\documentclass[12pt]{article}
\usepackage{threeparttable} % for "\tnote" macro and "tablenotes" environment
\usepackage{booktabs} % for well-spaced horizontal rules (\toprule, \midrule, etc.)

\begin{document}
\begin{table}[!htb]
\centering
    \begin{threeparttable}
    \begin{tabular}{ lccc }
    \toprule
    & col1 & col2 & col3\\ 
    \midrule
    row1 & val11\tnote{1} & val12          & val13 \\
    row2 & val21\tnote{1} & val22\tnote{z} & val23\tnote{z} \\
    \bottomrule
    \end{tabular}   

    \smallskip
    \footnotesize
    \begin{tablenotes}
    \item[1] A footnote which happens to be quite long.
    \item[z] A fairly short footnote
    \end{tablenotes}
    \caption{Caption of table.}    
    \end{threeparttable}
\end{table}

The text that follows the table is no longer preceded by superscript numerals 1 and 2.
\end{document}