# How to Reference a pgfplotstable

I am still generating a table from a cvs file with the pgfplotstable package. In my text I will reference to the generated table but I did not know how to do this. Normal your make a \label{tab:foo} and in the text you can reference to \ref{tab:foo}. How can I do this with the pgfplotstable? For more you can see my code

\usepackage{pgfplotstable}
\usepackage{booktabs}
\begin{document}

Here should be a text which is referencing to the Table~\ref{tab:foo}. But I did not know how to make a label at the table.

\pgfplotstableset{
begin table=\begin{longtable},
end table=\end{longtable},
}

\pgfplotstabletypeset[
col sep=semicolon,
string type,
columns/Hersteller/.style={column name=Hersteller, column type={l}},
columns/Produktname/.style={column name=Produktname, column type={l}},
columns/Betriebssystem/.style={column name=Betriebssystem, column type={l}},
columns/Version/.style={column name=Version, column type={l}},
every last row/.style={after row=\hline caption={foo}},
]{./files/NFCDeviceTabletStand20121230.csv}
\end{document}

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. A tip: You can use backticks  to mark your inline code as I did in my edit. –  hpesoj626 Dec 29 '12 at 15:03

You can do it just as with standard LaTeX tabular environments: using the table environment. The referencing mechanism is independent of pgfplotstable (which is nothing more but a generator of tabular environments).

It looks like this:

\begin{table}
\pgfplotstabletypeset ...

\caption{The caption}
\label{tab:foo}
\end{table}
`
-
Thanks It is workig fine –  felix Dec 29 '12 at 15:26