I am trying to set the caption of my table to center but I fail to do so. Here is my code:

\documentclass[a4paper,11pt]{report}
\setlength{\arrayrulewidth}{0.5mm}
\setlength{\tabcolsep}{10mm}
\renewcommand{\arraystretch}{1.5}
\usepackage{caption}

% \captionsetup{format=myformat}% global activation


\begin{document}
\begin{table}[h!]\begin{center}
\begin{tabular}{ |l||c|c| }
 \hline
 %\multicolumn{}{|c|}{Country List} \\
 Evaporator Pressure (bar)& Literature &Present Study\\
 \hline
 Afghanistan   & AF    &AFG\\
 Aland Islands&   AX  & ALA   \\
 Albania &AL & ALB\\
 Algeria    &DZ & DZA\\
 American Samoa&   AS  & ASM\\
 Andorra& AD  & AND   \\
 Angola& AO  & AGO\\
 \hline
\end{tabular}

\caption{Thermal efficiency comparison of Present study with O. Kaska []}

%\caption{Comparison of thermal efficiency of Present study with O. Kaska []}
%\label{table:1}
\end{center}\end{table}

\end{document}

I tried \usepackage[justification=centering]{caption} but it did not help. What can I do?

up vote 2 down vote accepted

The problem is not your \caption, but the fact that your tabular is too wide to fit within the text block width. Stick with using caption's justification=center option and consider reducing your adjustment for \tabcolsep.

Personally, I'd prefer the following layout (using booktabs):

enter image description here

\documentclass{article}

\usepackage{caption,booktabs}

\captionsetup{
  justification = centering
}

\begin{document}

\begin{table}
  \centering
  \begin{tabular}{ l c c }
    \toprule
    Evaporator Pressure (bar) & Literature & Present Study \\
    \midrule
    Afghanistan               &    AF      &     AFG       \\
    Aland Islands             &    AX      &     ALA       \\
    Albania                   &    AL      &     ALB       \\
    Algeria                   &    DZ      &     DZA       \\
    American Samoa            &    AS      &     ASM       \\
    Andorra                   &    AD      &     AND       \\
    Angola                    &    AO      &     AGO       \\
    \bottomrule
  \end{tabular}
  \caption{Thermal efficiency comparison of Present study with O.~Kaska~[]}
\end{table}

\end{document}

For more on how to make your table fit, see My table doesn't fit; what are my options?

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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