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}
elsarticleclass. Please provide a minimal working example where you have this problem. – Fran Sep 11 '12 at 17:08