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?
Best Answer
The problem is not your
\caption
, but the fact that yourtabular
is too wide to fit within the text block width. Stick with usingcaption
'sjustification=center
option and consider reducing your adjustment for\tabcolsep
.Personally, I'd prefer the following layout (using
booktabs
):For more on how to make your
table
fit, see My table doesn't fit; what are my options?