以下代码为表格提供全宽
\begin{table}[!b]
\processtable{Table title the architecture of the can be roughly sketched
consisting of a bottom sensor layer, a middle network layer, and a top application~layer}
{
\begin{tabular*}
{\textwidth}{@{\extracolsep{\fill}}llllll@{}}\toprule
\TCH{S.No} & \TCH{Type of } & \TCH{Algorithm} & \TCH{Problem Type} & \TCH{Integrated} & \TCH{Ref} \\
&\TCH{Learning used} & \TCH{used} & & \TCH{Method} & \\
\midrule
1&Opposition-Based Learning&OBMA (Opposition-Based Memetic Algorithm), HOBMA (Hybrid- Opposition-Based Memetic Algorithm)&Sorting permutations by reversals&&(Sonccoet.al, 2019)\\
\botrule
\end{tabular*}}
\end{table}
我想调整列的宽度,以便表格适合页面
答案1
tabular*
调整空间之间列。列将具有其自然宽度。如果您喜欢相反的宽度,请使用表格型或者表格反而。
示例 0 - xltabular
正如你在聊天中所要求的,我提供了一个使用多页表格的新示例板状的,结合了表格型和长桌. 可以使用长桌也是如此。但是,您随后需要使用p
-columns,并最终计算它们的宽度。
\documentclass{article}
\usepackage{lmodern}
\usepackage{geometry}
\usepackage{booktabs, xltabular, ragged2e}
\setlength{\tabcolsep}{4pt}
% Define an X-column where you can give relative width.
\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash\hsize=#1\hsize}X}
\usepackage[english]{babel} % Better hyphenation
\setlength{\LTcapwidth}{1.25\linewidth}
\begin{document}
\begin{xltabular}{\linewidth}{
@{}
L{0.3}
L{0.75} % Five X-column. Sum of fractions must be 5X.
L{2.2}
L{0.75}
L{0.6}
L{0.45}
@{}
}
\caption{The architecture of the can be roughly sketched
consisting of a bottom sensor layer, a middle network layer, and a top application~layer\label{tab:architecture }}\\[\belowcaptionskip]
\toprule
S.No & Type of Learning used & Algorithm used & Problem Type & Inte\-grated Method & Ref \\
\midrule
\endfirsthead
\toprule
S.No & Type of Learning used & Algorithm used & Problem Type & Integrated Method & Ref \\
\midrule
\endhead
1&Opposi\-tion-Based Learning&OBMA (Opposition-Based Meme\-tic Algorithm), HOBMA (Hybrid- Opposition-Based Memetic Algorithm)&Sorting permutations by reversals&&(Soncco et.al, 2019)\\
2&Opposition-based Learning&IFPA (Improved Flower pollination algorithm)&User Identification in social networks&&(Li et.al, 2019)\\
3&Quasi- Opposition-based Learning&QODE (Quasi Oppositional Differential Evolution)&Predicting intensification of OBL &&(Xu et.al, 2019)\\
4&WOBL (Worst Opposition-based Learning)&IBBOA (Improved Biogeography Based Optimization Algorithm)&Medical image segmentation, clustering optimization&&(Zhang et.al, 2019)\\
5&Opposition-based Learning&CSA (Cine Cosine Algorithm)&Improvement of text of satellite images&&(Singh et.al, 2019)\\
6&Oppositional Global based learning&OGHS (Oppositional Global based Harmony Search)&MOFJSP (Multi-Objective Flexible Job-Shop SchedulingProblems)&&(Jian et.al, 2019)\\
7&MOBL (Modified Opposition-Based Learning)&GWO-HS (Grey Wolf Optimizer based Harmony Search)&Parameter Selection&(GWO) Grey Wolf Optimizer&(Alo\-moush et.al, 2019)\\
8&Opposition-Based Learning&DSLPSO (Dynamic Self Learning Particle Swarm Optimization)&Parameter Estimation for PMSM (Permanent Magnet Synchronous Machines)&&(Liu et.al, 2018)\\
9&Opposition-based Learning.&IPOL-HS (Improved Partial Opposition Learning based Harmony Search)&Package Query Processing&&(Shi et.al, 2018)\\
10&Opposition-Based Learning&MHS (Modified Harmony Search Algorithm)&Reconstruc\-tion of defect profiles in pipelines from MFL (Magnetic Flux Leakage)&&(Li et.al, 2018)\\
\bottomrule
\end{xltabular}
\end{document}
示例 1 -表格型
\documentclass{article}
\usepackage{array, tabularx, booktabs}
\setlength{\extrarowheight}{2pt}
\renewcommand*{\arraystretch}{1.2}
\begin{document}
\begin{table}[!bh]
\caption{Table title the architecture of the can be roughly sketched
consisting of a bottom sensor layer, a middle network layer, and a top application~layer}
\begin{tabularx}{\textwidth}{@{}XXXXXX@{}}\toprule
S.No & Type of & Algorithm & Problem Type & Integrated & Ref \\
& Learning used & used & & Method & \\
\midrule
1&Opposition-Based Learning&OBMA (Opposition-Based Memetic Algorithm), HOBMA (Hybrid- Opposition-Based Memetic Algorithm)&Sorting permutations by reversals&&(Soncco et.al, 2019)\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
示例 2 -表格型+ 固定宽度列
\documentclass{article}
\usepackage{array, tabularx, booktabs}
\setlength{\extrarowheight}{2pt}
\renewcommand*{\arraystretch}{1.2}
\begin{document}
\begin{table}[!bh]
\caption{Table title the architecture of the can be roughly sketched
consisting of a bottom sensor layer, a middle network layer, and a top application~layer}
\begin{tabularx}{\textwidth}{@{}wl{15pt}>{\raggedright\arraybackslash}Xp{3cm}XXX@{}}\toprule
S.No & Type of Learning used & Algorithm used & Problem Type & Integrated Method & Ref \\
\midrule
1&Opposition-Based Learning&OBMA (Opposi-tion-Based Meme-tic Algorithm), HOBMA (Hybrid- Opposition-Based Memetic Algorithm)&Sorting permutations by reversals&&(Soncco et.al, 2019)\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
示例 3 -表格
另外,看一下 tabulary。使用一个固定宽度 (wl{15pt)} 列和合理的 \tymin 和 \tymax,它可以正常工作:
\documentclass{article}
\usepackage{array, tabulary, booktabs}
\setlength{\extrarowheight}{2pt}
\renewcommand*{\arraystretch}{1.2}
\setlength{\tymin}{35pt}
\setlength{\tymax}{300pt}
\begin{document}
\begin{table}[!bh]
\caption{Table title the architecture of the can be roughly sketched
consisting of a bottom sensor layer, a middle network layer, and a top application~layer}
\begin{tabulary}{\textwidth}{@{}wl{15pt}LLLLL@{}}\toprule
S.No & Type of Learning used & Algorithm used & Problem Type & Integrated Method & Ref \\
\midrule
1&Opposition-Based Learning&OBMA (Opposi-tion-Based Meme-tic Algorithm), HOBMA (Hybrid- Opposition-Based Memetic Algorithm)&Sorting permutations by reversals&&(Soncco et.al, 2019)\\
\bottomrule
\end{tabulary}
\end{table}
\end{document}