# How to refer to table in lyx

Inside the float table box I add lyx:label but when inside the text and choose insert crossreference and choose the table label the text appears as ??

The reference to numbered equations appear normally , the problem is in table labels only.

I use elsarticle class

-
In my LyX the cross reference to tables works without problem with the elsarticle class. Please provide a minimal working example where you have this problem. –  Fran Sep 11 '12 at 17:08
where to put the lable inside table? –  mero Sep 11 '12 at 17:14

This MWE is the raw opuput of from complete source view in Lyx minus the comments. The label inside the caption is OK. Just after the caption also work, but inside the tabular environment is a wrong place.

\documentclass[english]{elsarticle}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\makeatletter
\providecommand{\tabularnewline}{\\}
\makeatother
\usepackage{babel}

\begin{document}

A cross reference to table \ref{tab:one}
\begin{table}
\begin{tabular}{|c|c|c|}
\hline
This & is & a table \tabularnewline
\hline
\end{tabular}
\caption{\label{tab:one}The caption of table one}
\end{table}

\end{document}

-
thanks so much the problem was that label not inside the caption box of table or figure, thank you –  mero Sep 11 '12 at 18:22