表格标题居中

表格标题居中

我试图将表格的标题设置为居中,但失败了。这是我的代码:

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

我试过了\usepackage[justification=centering]{caption},但没有效果。我该怎么办?

答案1

问题不在于您的\caption,而在于您的tabular太宽,无法容纳在文本块宽度内。坚持使用captionjustification=center选择,并考虑减少您的调整\tabcolsep

就我个人而言,我更喜欢以下布局(使用booktabs):

在此处输入图片描述

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

有关如何制作您的table健康身材的更多信息,请参阅我的桌子放不下;我有什么办法吗?

相关内容