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.
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.
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}

\documentclass{...}and ending with\end{document}. – doncherry May 06 '13 at 04:24