這裡是範本我用於以下用途 雜誌。我對常規乳膠文件中完美的所有表格都有問題。這是包含所有表格的頁面:
這是我新增的套件和表格:
% *** MATH PACKAGES ***
%
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{algorithm}
\usepackage{textcomp}
\usepackage{filecontents}
\usepackage{microtype}
\usepackage{float}
\usepackage{adjustbox}
\usepackage{booktabs,makecell,tabularx}
\usepackage{url}
\usepackage{booktabs}
\usepackage{subfigure}
\newcommand{\tvar}[2]{%
\mathrm{#1}_{\mathrm{#2}}%
}
\renewcommand\theadfont{\small}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{siunitx}
\usepackage[utf8]{inputenc}
\renewcommand{\thetable}{\arabic{table}}
\usepackage{etoolbox}
\usepackage{xparse}
\makeatletter
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\begin{document}
\begin{table}[!htb]
\centering
\setlength{\tabcolsep}{2pt}
\small
\begin{tabularx}{0.6\columnwidth}{@{}c L S[table-format=7.0]*{2}{S[table-format=2.0]}@{}}
\toprule
\thead{ID} & \thead{UCI Dataset Name}
& {\thead{Samples}}
& {\thead{Attributes}}
& {\thead{Classes}} \\
\midrule
DS2 & \textbf {Pfsddfs}- cdfsads dfsdffdss & 2222222 & 22 & 5 \\
DS2 & \textbf {ESSSS} - cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss
& 45555 & 9 & 2 \\
DS3 & \textbf {AAAA} - cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss & 22222 & 54 & 7 \\
DS4 & \textbf {ABBB} - cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss & 539383 & 28 & 2 \\
DS5 & \textbf {SSSS} & 60000 & 3 & 3 \\
\bottomrule
\end{tabularx}
\caption{Ssdfsdfsddgs dgfgdsg gsdgsfggdfsfgd sdfgfgsd}
\label{table:2}
\end{table}
\begin{table}[!htb]
\centering
\sisetup{table-format=2.3, table-number-alignment=center, tight-spacing,}% table-column-width =2.5cm
\setlength{\tabcolsep}{3pt}
\small
\centering
\sisetup{detect-weight,mode=text}
\renewrobustcmd{\bfseries}{\fontseries{b}\selectfont}
\renewrobustcmd{\boldmath}{}
% abbreviation
\newrobustcmd{\B}{\bfseries}
% shorten the intercolumn spaces
\setlength{\tabcolsep}{4pt}
\begin{tabular}{l>{\centering}lSSSS}
\toprule
\thead {Dataset \\ Name} & {\thead{No. of processed \\ records} }& {\thead{fsad fsd Trfsdee\\ Acc }} & {\thead{fsdd\\ Acc} }
& {\thead{dfsadf Alg\\Acc} } & {\thead{dfsfds fsd\\ J48}} \\ [0.5ex]
\midrule
Pfds fssdf & 200K to 900K & 0.504 & 0.504 & \B 0.504 & 0.504 \\
Pfds fssd & 200K to 900K & 0.524 & \B 0.546 & \B 0.546 & 0.498\\
dfsfs & 200K to 900K & 0.504 & \B0.832 & \B 0.504 & 0.504 \\
fssdf & 200K to 900K & 0.504 & \B0.754 & \B 0.754& 0.702 \\
Codsffdspe & 200K to 900K & 0.622 & 0.504 & \B 0.504 & 0.676 \\
Codsffdspe & 200K to 900K & 0.563 & \B0.674 & 0.665 & 0.686 \\
sdfdf & 200K to 900K & 0.956 & \B 0.957 & 0.956 & 0.945\\
sdfdf & 200K to 900K & 0.949 & \B0.504 & \B 0.955 & 0.952\\
dsa & 20K to 90K & 0.895 & 0.798 & \B 0.504 & 0.853\\
dsa & 20K to 90K & 0.924 & 0.834 & \B 0.932
& 0.927\\
dsa-2 & 20K to 90K & 0.899 & 0.906 & \B 0.943 & 0.942\\
SdsaA-2 & 20K to 90K & 0.892 & \B0.947 & \B 0.947 & 0.942\\
SEdsaA-3 & 20K to 90K & 0.884 & 0.832 & \B 0.897 & 0.846\\
[2ex]
\bottomrule
\end{tabular}
\caption{Csdfdfsdfs CsdfdfsdfsCsdfdfsdfsCsdfdfsdfsCsdfdfsdfs)}
\label{table:2a}
\end{table}
\begin{table}[!htb]
\centering
\sisetup{table-format=2.3, table-number-alignment=center, tight-spacing,}% table-column-width =2.5cm
\setlength{\tabcolsep}{3pt}
\small
\centering
\sisetup{detect-weight,mode=text}
\renewrobustcmd{\bfseries}{\fontseries{b}\selectfont}
\renewrobustcmd{\boldmath}{}
% abbreviation
\newrobustcmd{\B}{\bfseries}
% shorten the intercolumn spaces
\setlength{\tabcolsep}{4pt}
\begin{tabular}{l>{\centering}lSSSS}
\toprule
\thead {Dataset \\ Name} & {\thead{fsddsf \\ records} }& {\thead{Hsfd\\ Acc }} & {\thead{fsdsf\\ Acc} }
& {\thead{sfdfsd sfdf\\Acc} } & {\thead{fsd fs\\ fsd}} \\ [0.5ex]
\midrule
fsdfs fsd & 100K to 900K & 0.504 & 0.547 & \B 0.548 & 0.503 \\
fsdfs fsd & 200K to 900K & 0.524 & 0.548 & \B 0.550 & 0.498\\
sfddfs& 200K to 900K & 0.788 & \B0.833 & 0.832 & 0.824 \\
fddfs& 200K to 900K & 0.680 & 0.757 & \B 0.758& 0.702 \\
Cosdfype & 200K to 900K & 0.622 & 0.735 & \B 0.735 & 0.676 \\
Cdfspe & 200K to 900K & 0.563 & 0.677 & \B 0.678 & 0.686 \\
Airfsd & 200K to 900K & 0.956 & 0.959 & \B 0.962 & 0.945\\
dfsf & 200K to 500K & 0.949 & \B0.958 & \B 0.958 & 0.952\\
SfdsEA & 20K to 90K & 0.895 & 0.802 & \B 0.899 & 0.853\\
SEfdsA & 20K to 90K & 0.924 & 0.836 & \B 0.934 & 0.927\\
fds-2 & 20K to 90K & 0.899 & 0.935 & \B 0.943 & 0.942\\
fds-2 & 20K to 90K & 0.892 & 0.952 & \B 0.954 & 0.942\\
Sfds3 & 20K to 90K & 0.884 & 0.853 & \B 0.897 & 0.846\\
[2ex]
\bottomrule
\end{tabular}
\caption{fgdfgdsgsf (In \textbf{Bold} thedfgsdfggf)}
\label{table:2b}
\end{table}
\begin{table}[!htb]
\centering
\sisetup{table-format=2.3, table-number-alignment=center, tight-spacing,}% table-column-width =2.5cm
\setlength{\tabcolsep}{3pt}
\small
\centering
\sisetup{detect-weight,mode=text}
\renewrobustcmd{\bfseries}{\fontseries{b}\selectfont}
\renewrobustcmd{\boldmath}{}
% abbreviation
\newrobustcmd{\B}{\bfseries}
% shorten the intercolumn spaces
\setlength{\tabcolsep}{4pt}
\begin{tabular} {l c c} %{l>{\centering}lSSSS}
\toprule
\thead {Dataset \\ Name} & {\thead{dsaasd add dada (sec) \\ 1000 dsad} } & {\thead{adsdas das ddsa Time (sec) \\ 2000 fdsfds}} \\ [0.5ex]
\midrule
dfg gdfs & 22.222 & 4.4222\\
sdfgg& 22.222 & 4.0222 \\
sdfggsd & 22.222 & 22.2226\\
dsfggfd & 32.355 & 2.277 \\
dfd & 20.254 & 2.238 \\
[2ex]
\bottomrule
\end{tabular}
% \end{tabular}
\caption{fgdfgsd}
\label{table:3}
\end{table}
\end{document}
答案1
無關:
- 在您的 MWE 中錯過了文檔類別。對於我的 MWE,我使用
IEEEtran
. - 從你的序言中,我只考慮了與你的表相關的包(其他我從我的MWE 中刪除,但是再次檢查,如果你真的需要所有這些包,並且其中一些包是否加載了兩次) 。
- 如果文章是針對某些 IEEE 期刊,請勿重新格式化其標題等的預設設定。
表格:
- 我建議將所有新命令定義從表格移至序言(例如
\newrobustcmd{\B}{\bfseries}
. - 從表中刪除所有重複的設定(例如
\centering
等\tabcolsep
)。 - 目前尚不清楚為什麼選擇的第一個表格的寬度比列的寬度小得多。
- 在下面的 MWE 中,我清理了表程式碼並嘗試以統一的方式設計它們。
你的問題:
- (對我來說)不清楚你的問題是什麼。桌子設計?
\documentclass{IEEEtran}
%\usepackage{amsmath} is supersede by mathtools,
\usepackage{mathtools}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\usepackage{textcomp}
\usepackage{microtype}
\usepackage{booktabs,makecell,tabularx}
\renewcommand\theadfont{\small}
\renewcommand\theadgape{}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{siunitx}
\usepackage{etoolbox}
\newrobustcmd{\B}{\bfseries}
\begin{document}
\begin{table}[!htb]
\small
\setlength{\tabcolsep}{3pt}
\caption{Ssdfsdfsddgs dgfgdsg gsdgsfggdfsfgd sdfgfgsd}
\label{table:2}
\begin{tabularx}{\linewidth}{@{} c L S[table-format=7.0]*{2}{S[table-format=2.0]} @{}}
\toprule
\thead{ID} & \thead{UCI Dataset Name} & {\thead{Samples}} & {\thead{Attributes}} & {\thead{Classes}}\\
\midrule
DS2 & \textbf{Pfsddfs}- cdfsads dfsdffdss & 2222222 & 22 & 5 \\
DS2 & \textbf{ESSSS} - cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss
& 45555 & 9 & 2 \\
DS3 & \textbf{AAAA} - cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss & 22222 & 54 & 7 \\
DS4 & \textbf{ABBB} - cdfsads dfsdffdss cdfsads dfsdffdss cdfsads dfsdffdss & 539383 & 28 & 2 \\
DS5 & \textbf{SSSS} & 60000 & 3 & 3 \\
\bottomrule
\end{tabularx}
\end{table}
\begin{table}[!htb]
\sisetup{detect-weight,
mode=text,
table-format=2.3}
\setlength{\tabcolsep}{0pt}
\caption{Csdfdfsdfs Csdfdf sdfsCsdf dfsdfs CsdfdfsdfsCs dfdfsdfs)}
\label{table:2a}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l c SSSS}
\toprule
\thead[b]{Dataset \\ Name}
& {\thead[b]{No. of\\ processed \\ records} }
& {\thead[b]{fsad fsd\\ Trfsdee\\ Acc }}
& {\thead[b]{fsdd\\ Acc} }
& {\thead[b]{dfsadf\\ Alg\\Acc} }
& {\thead[b]{dfsfds fsd\\ J48}} \\
\midrule
Pfds fssdf & 200K to 900K & 0.504 & 0.504 & \B 0.504 & 0.504 \\
Pfds fssd & 200K to 900K & 0.524 & \B 0.546 & \B 0.546 & 0.498 \\
dfsfs & 200K to 900K & 0.504 & \B 0.832 & \B 0.504 & 0.504 \\
fssdf & 200K to 900K & 0.504 & \B 0.754 & \B 0.754 & 0.702 \\
Codsffdspe & 200K to 900K & 0.622 & 0.504 & \B 0.504 & 0.676 \\
Codsffdspe & 200K to 900K & 0.563 & \B 0.674 & 0.665 & 0.686 \\
sdfdf & 200K to 900K & 0.956 & \B 0.957 & 0.956 & 0.945 \\
sdfdf & 200K to 900K & 0.949 & \B 0.504 & \B 0.955 & 0.952 \\
dsa & 20K to 90K & 0.895 & 0.798 & \B 0.504 & 0.853 \\
dsa & 20K to 90K & 0.924 & 0.834 & \B 0.932 & 0.927 \\
dsa-2 & 20K to 90K & 0.899 & 0.906 & \B 0.943 & 0.942 \\
SdsaA-2 & 20K to 90K & 0.892 & \B 0.947 & \B 0.947 & 0.942 \\
SEdsaA-3 & 20K to 90K & 0.884 & 0.832 & \B 0.897 & 0.846 \\
\bottomrule
\end{tabular*}
\end{table}
\begin{table}[!htb]
\sisetup{table-format=2.3,
detect-weight,
mode=text}% table-column-width =2.5cm
\setlength{\tabcolsep}{3pt}
\small
\caption{fgdfgdsgsf (In \textbf{Bold} thedfgsdfggf)}
\label{table:2b}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}l c SSSS}
\toprule
\thead {Dataset \\ Name}
& {\thead{fsddsf \\ records} }
& {\thead{Hsfd\\ Acc }}
& {\thead{fsdsf\\ Acc} }
& {\thead{sfdfsd sfdf\\Acc} }
& {\thead{fsd fs\\ fsd}} \\ [0.5ex]
\midrule
fsdfs fsd & 100K to 900K & 0.504 & 0.547 & \B 0.548 & 0.503 \\
fsdfs fsd & 200K to 900K & 0.524 & 0.548 & \B 0.550 & 0.498 \\
sfddfs & 200K to 900K & 0.788 & \B 0.833 & 0.832 & 0.824 \\
fddfs & 200K to 900K & 0.680 & 0.757 & \B 0.758 & 0.702 \\
Cosdfype & 200K to 900K & 0.622 & 0.735 & \B 0.735 & 0.676 \\
Cdfspe & 200K to 900K & 0.563 & 0.677 & \B 0.678 & 0.686 \\
Airfsd & 200K to 900K & 0.956 & 0.959 & \B 0.962 & 0.945 \\
dfsf & 200K to 500K & 0.949 & \B 0.958 & \B 0.958 & 0.952 \\
SfdsEA & 20K to 90K & 0.895 & 0.802 & \B 0.899 & 0.853 \\
SEfdsA & 20K to 90K & 0.924 & 0.836 & \B 0.934 & 0.927 \\
fds-2 & 20K to 90K & 0.899 & 0.935 & \B 0.943 & 0.942 \\
fds-2 & 20K to 90K & 0.892 & 0.952 & \B 0.954 & 0.942 \\
Sfds3 & 20K to 90K & 0.884 & 0.853 & \B 0.897 & 0.846 \\
\bottomrule
\end{tabular*}
\end{table}
\begin{table}[!htb]
\caption{fgdfgsd}
\label{table:3}
\sisetup{table-format=2.4}% table-column-width =2.5cm
\centering
\small
\begin{tabular} {l S S }
\toprule
\thead {Dataset \\ Name}
& {\thead{dsaasd add dada (sec) \\ 1000 dsad} }
& {\thead{adsdas das ddsa Time (sec) \\ 2000 fdsfds}} \\
\midrule
dfg gdfs & 22.222 & 4.4222 \\
sdfgg & 22.222 & 4.0222 \\
sdfggsd & 22.222 & 22.2226 \\
dsfggfd & 32.355 & 2.277 \\
dfd & 20.254 & 2.238 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}