3

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?

2

1 Answer 1

3

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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .