IEEE 格式的表格的行?

IEEE 格式的表格的行?

我正在嘗試在 IEEE 事務範本中插入一個表格,並且我希望表格的行邊框具有不同的粗細,如下圖所示。你能幫我嗎?而且,即使嘗試了幾個小時,也無法完成文字。 在此輸入影像描述

請注意:我必須使用 IEEE 模板,無法更改。由此可見,此表需要位於一頁的 1 列(共 2 列)。我的程式碼如下:

\documentclass[journal]{IEEEtran}

\begin{document}

\setlength{\arrayrulewidth}{0.5mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{ |p{0.9cm}|p{0.9cm}|p{0.9cm}|p{0.9cm}|  }
\hline
\multicolumn{4}{|c|}{Title} \\
\hline
Serial Number& Column1&Column2&Column3\\
\hline
Row 1& AF & AFG  & AFG  \\
%\specialrule{0.01em}{0.1em}{0.1em}
\hline
Row 2& AX   & ALA & AFG \\
Row 3&AL & ALB  & AFG \\
Row 4&DZ & DZA  & AFG \\
Row 5& AS & ASM  & AFG  \\
Row 6& AD & AND   & AFG  \\
Row 6& AOffffffffffffffffffffffffffffffff& AGO & AFG  \\
%\specialrule{0.01em}{0.1em}{0.1em}
\hline
\end{tabular}

\end{document}

答案1

由於您必須遵循文檔類提供的樣式指南IEEEtran,因此我不會弄亂\tabcolsep和的值\arrayrulewidth。我還將表格材料嵌入table環境中。要對長非單字(例如 )進行換行AOffffffffffffffffffffffffffffffff,我建議將它們包含在\seqsplit巨集中。關於水平線的線條樣式:是否可以選擇插入垂直空白而不是繪製虛線?

請考慮透過 (a) 消除所有垂直線來改進表格的外觀(IEEEtran 樣式指南確實不是需要使用垂直規則),(b)確保足夠的列寬,以及(c)使用書本標籤包而不是\hline\cline

在此輸入影像描述

\documentclass[journal]{IEEEtran}
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage{calc}     % for \widthof macro
\usepackage{seqsplit} % for \seqsplit macro

\begin{document}

\begin{table}[h]
\centering
\renewcommand{\arraystretch}{1.05} % 1.5 is much too large
\caption{Title}

\begin{tabular}{@{} p{\widthof{Number}} *{3}{p{\widthof{Column1}}} @{}} 
\toprule
Serial Number & Column1 &Column2 & Column3 \\
\midrule
Row 1& AF & AFG  & AFG  \\
\addlinespace % whitespace is a very effective visual separator
Row 2& AX & ALA  & AFG  \\
Row 3& AL & ALB  & AFG  \\
Row 4& DZ & DZA  & AFG  \\
Row 5& \seqsplit{AOffffffffffffffffffffffffffffffff} & ASM  & AFG  \\
Row 6& Hello World & AND  & AFG  \\
Row 7& AO & AGO  & AFG  \\
\bottomrule
\end{tabular}
\end{table}

\hrule % illustrate column width

\end{document}

相關內容