I am using a macro to define certain labels inside a tabular environment, however when I refer to these labels later the displayed text is the section number instead of the desired label.
What's the easiest way to achieve the desired result? (See code below for the precise situation.)
One solution which I don't like: passing the label name into the "FOOFOO" macro. I don't necessarily want to give labels to all my FOOFOOs
\documentclass{article}
\newcounter{foo}
\renewcommand{\thefoo}{F\arabic{foo}}
\newcommand{\FF}{
\refstepcounter{foo}\textbf{\thefoo}
}
\newenvironment{footab}{\begin{tabular}{c|c|c}\hline}{\end{tabular}}
\newcommand{\FOOFOO}[2]{%
\FF & \textbf{#1} & #2 \\\hline%
}
\begin{document}
\section{My section}
\label{sec:my-section}
\begin{footab}
\FOOFOO{One}{First example}\label{foo:first}
\FOOFOO{Two}{Second example \label{foo:second}}
\end{footab}
Now I write some stuff referring to \ref{foo:first} (should be F1) and
\ref{foo:second} (should be F2).
\end{document}
The output looks like this:

