The problem based on the way how ctable wrote the information to the aux. There you can find the following relevant line:
\newlabel{tab:ctable}{{0.2}{1}{\@ctblcap \relax }{table.0.2}{}}
If you use \nameref{tab:ctable} the argument {\@ctblcap \relax } is called. However the command is undefined and it uses the special character @. Based on this information the first quick fix is:
\makeatletter
\def\@ctblcap{Table}
\nameref{tab:ctable} %error
\makeatother
On the other hand you can change the implementation of ctable:
\usepackage{etoolbox} %provided \expandonce
\makeatletter
\def\@ctblCaption{
\ifx\@ctblcap\undefined\let\@ctblcap\@ctblcaption\fi
\ifx\@ctblcaption\empty\else
\def\@ctblcaptionarg{\ifx\@ctbllabel\empty\else\label{\@ctbllabel}\fi
\@ctblcaption\ \@ctblcontinued\strut}
\ifx\@ctblcap\empty
\begingroup
\edef\x{\endgroup\noexpand\caption[]{\expandonce\@ctblcaptionarg}}
\x
\else
\begingroup
\edef\x{\endgroup\noexpand\caption[\expandonce\@ctblcap]%
{\expandonce\@ctblcaptionarg}}
\x
\fi
\fi
}
\makeatother
The relevant part are the lines starting with \edef\x. E.g.:
\begingroup
\edef\x{\endgroup\noexpand\caption[]{\expandonce\@ctblcaptionarg}}
\x
whereby the original code was:
\caption[]{\@ctblcaptionarg}
The command caption doesn't expand the information of its arguments. So in the aux file you have the entry \@ctblcaptionarg. Instead of a complete expansion of \@ctblcaptionarg I used \expandonce which is more robust in this case.
The complete MWE:
\documentclass{scrreprt} %DIV, BCOR =Seitenränder
\usepackage[]{ctable}
\usepackage{etoolbox}
\usepackage{hyperref}
\makeatletter
\def\@ctblCaption{
\ifx\@ctblcap\undefined\let\@ctblcap\@ctblcaption\fi
\ifx\@ctblcaption\empty\else
\def\@ctblcaptionarg{\ifx\@ctbllabel\empty\else\label{\@ctbllabel}\fi
\@ctblcaption\ \@ctblcontinued\strut}
\ifx\@ctblcap\empty
\begingroup
\edef\x{\endgroup\noexpand\caption[]{\expandonce\@ctblcaptionarg}}
\x
\else
\begingroup
\edef\x{\endgroup\noexpand\caption[\expandonce\@ctblcap]%
{\expandonce\@ctblcaptionarg}}
\x
\fi
\fi
}
\makeatother
\begin{document}
\begin{verbatim}
\ref{tab:table} %ok
\autoref{tab:table} %ok
\nameref{tab:table} %ok
\end{verbatim}
\ref{tab:table} %ok
\autoref{tab:table} %ok
\nameref{tab:table} %ok
\begin{verbatim}
\ref{tab:ctable} %ok
\autoref{tab:ctable} %ok
\nameref{tab:ctable} %error
\end{verbatim}
\ref{tab:ctable} %ok
\autoref{tab:ctable} %ok
\nameref{tab:ctable} %error
\begin{table}[h]
\centering
\begin{tabular}{|l|l}
hallo & bello\\
\end{tabular}
\caption{Table}
\label{tab:table}
\end{table}
\ctable[caption = Ctable, label=tab:ctable,]{ll}{}{
Hello & bello \LL}
\end{document}
I think you should write bug report to the author of ctable.
\nameref(and\autoref) actually DOES work for table captions. – Axel Sommerfeldt May 26 '12 at 6:48