I'm creating a table like this:

\begin{tabular}{@{} *5l @{}}\toprule
\emph{header1} & \emph{header2} & \emph{header3} \\\midrule
item1 & v1  & v2   \\
item2 & v1  & v2   \\
item2 & v1  & v2   \\

This way the caption gets separated from the table and if it reaches the end of the page the table might go to the next page while its caption remains on the previous page. If I move the caption inside tabular I get an error:

You can't use `\hrule' here except with leaders.
\caption@hrule ->\hrule

and if I use \caption instead:

Package caption Error: \caption outside float

I've added these lines to use caption for my tables:


Have you considered using the booktabs package?

This is your example a little re-arranged:



\renewcommand{\thetable}{\Roman {table}}


    \caption{Table's caption}\label{tab:label}
        \emph{header1} & \emph{header2} & \emph{header3} \\
        item1 & v1  & v2   \\
        item2 & v1  & v2   \\
        item2 & v1  & v2   \\


enter image description here

  • He's already using booktabs, partially at least. (Note the \toprule.) – Torbjørn T. Jun 6 '14 at 14:50
  • I didn't noticed, I saw the \hline at the end. – Mario S. E. Jun 6 '14 at 14:54
  • yea I forgot to mention I'm using booktabs as well. But this one works fine. Just one more thing. My doc is not in english but I want numerals in my table to be latin. How can I do that? – soroosh.strife Jun 6 '14 at 15:02
  • 1
    You can do it with \renewcommand{\thetable}{\Roman{table}}. See my updated answer – Mario S. E. Jun 6 '14 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.