\begin{table}[H]
\caption{左对齐-阻止浮动}
\begin{tabularx}{\textwidth}{XX}
\toprule
\textbf{Symptom} & \textbf{Metric} \\
\midrule
Class that has many accessor methods and accesses a lot of external data & ATFD is more than a few\\
Class that is large and complex & WMC is high \\
Class that has a lot of methods that only operate on a proper & \\
\bottomrule
\end{tabularx}
\end{table}
\begin{table}[h]
\caption{左对齐-允许浮动}
\begin{tabularx}{\textwidth}{XX}
\toprule
\textbf{Symptom} & \textbf{Metric} \\
\midrule
Class that has many accessor methods and accesses a lot of external data & ATFD is more than a few\\
Class that is large and complex & WMC is high \\
Class that has a lot of methods that only operate on a proper & \\
\bottomrule
\end{tabularx}
\end{table}
必要任务 (请在 [ ] 内填入 "x" 表明完成此项任务
[x] 已搜索过已经关闭的 issues
想要使表格同图片一样允许浮动,修改位置参数H为其他组合,如
h
,'htp'。浮动效果生效,但表内字体行高发生变化,与正文设置不一致。示例对比
效果
其他说明 我尝试初步的解决方案是给每个允许浮动的表格单独添加了
\setstretch{1.5}
。