2

I have this code

\begin{table}[H]
  \caption{My Caption }
  \centering
  \begin{tabular}{*{6}{|p{3cm}}}
  \hline\hline

But caption comes at bottom.

I can't use this

\begin{table}[Ht]

as it gives error.

user17
  • 333
  • Please complement your code to a complete 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}. – doncherry May 06 '13 at 04:24

1 Answers1

1

Here is a working example, but as doncherry says, provide a MWE if this is not what you want.

\documentclass{article}

\usepackage[tableposition = top]{caption}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}

\begin{table}
 \centering
  \caption{A caption.}
  \label{table:triathlon}
  \begin{tabular}{l *{2}{S[table-format = 3]}}
   \toprule
             & {Triathlon}     & {Ironman}       \\
             & {\si{\percent}} & {\si{\percent}} \\
   \midrule
    Swimming &   3             &   2             \\
    Cycling  &  50             &  80             \\
    Running  &  47             &  19             \\
   \midrule
    Total    & 100             & 101             \\   
   \bottomrule
  \end{tabular}
\end{table}

This is table~\ref{table:triathlon}.

\end{document}

output