Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

How to put a caption on top of Latex table

Writer Olivia Zamora

I want to put a caption on top of the following table in Latex.

\begin{center}
\begin{tabular}{ | l | l | l | l | l | l | l | l | l | p{5cm} |}
\hline
GT & MT & PT & ML & FP & FN & ID & FM & Rc & Pr \\ \hline
abc & abc & abc & abc & abc & abc & abc & abc & abc & abc \\ \hline
\hline
\end{tabular}
\end{center}
1

1 Answer

You do not make a table, but only a tabular (which cannot have a caption). You have to make a table first, and then a tabular:

\begin{table}[htb] \centering % instead of \begin{center} \caption{Here you can type in your caption} \vspace{10mm} % Adjust the height of the space between caption and tabular \begin{tabular}{ | l | l | l | l | l | l | l | l | l | p{5cm} |} \hline GT & MT & PT & ML & FP & FN & ID & FM & Rc & Pr \\ \hline abc & abc & abc & abc & abc & abc & abc & abc & abc & abc \\ \hline \hline \end{tabular}
\end{table}

Further explanation: "The table environment merely holds our other environments and allows to add a caption to our table. The actual data is contained in the tabular environment and we center the table on the page using the center environment."

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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