
我的MWE:
\documentclass[12pt,twoside]{article}
\usepackage{tabularx}
\begin{document}
\begin{table}[ht]
\centering
\caption{Results}
\begin{tabularx}{14.36cm}{|c|c|c|c|c|c|}
\hline
Column & c1 & c2 & c3 & c4 & c5 \\
\hline
r1 & 0 & 0 & 0 & 0 & 0 \\
r2 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{tabularx}
\end{table}
\end{document}
輸出的表標題為“表 1:結果”
相反,我想要“表格1。結果”
答案1
我會使用該caption
包,如下所示:
\usepackage[labelfont=bf,labelsep=period]{caption}
\documentclass[12pt,twoside]{article}
\usepackage{tabularx}
\usepackage[labelfont=bf,labelsep=period]{caption}
\begin{document}
\begin{table}[ht]
\footnotesize
\centering
\caption{Results}
\begin{tabularx}{14.36cm}{|c|c|c|c|c|c|}
\hline
Column & c1 & c2 & c3 & c4 & c5 \\
\hline
r1 & 0 & 0 & 0 & 0 & 0 \\
r2 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{tabularx}
\end{table}
\end{document}
產量:
無論如何,正如 @CarLaTeX 指出的那樣,結果很醜陋,不是因為使用了tabularx
,而主要是因為表格是以固定長度排版的,這在右側產生了一個醜陋的列,以適應整個屏幕
我冒昧地改變了OP發布的一些內容,以排版我認為更好看的表格。既然問題已經解決了,我就把它留在這裡當作替代方案。
我基本上丟失了tabularx
包裹(不需要)並包含在內booktabs
(針對不同的規則)。我還失去了垂直分隔符號(排版醜陋)並合理化了水平分隔符號。
我還添加了額外的數據。我認為,為了更好地排版表格,必須更多地了解這些列中要排版的內容,而這不是本答案中可以討論的內容(至少:它可以,但它是偏離主題的)。
我建議 OP 嘗試代碼(如果他願意的話),並在他覺得需要時提出另一個問題。
代碼:
\documentclass[12pt,twoside]{article}
\usepackage[labelfont=bf,labelsep=period]{caption}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\caption{Results}
\begin{tabular}{cccccc}
\toprule
Column & c1 & c2 & c3 & c4 & c5 \\
\midrule
r1 & 0 & 100 & 50 & text & 0 \\
r2 & 0 & 0 & 0 & 0 & 0 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
結果: