我希望所有数据都集中在每个单元格中,例如:II 类的运行高度和任务半径。有人能帮助我吗?
这是我的代码:
\begin{table}[H]
\centering
\scalebox{0.95}{
\begin{tabular}{|c|c|c|c|c|}
\hline
NATO Class & Category & Employment & Operating Altitude & Mission Radius\\
& & & (ft) & (km)\\
\hline
\multirow{2}{*}{Class III (> 600 kg)} & HALE*(fig.\ref{hawk}) & National & 65 000 & BLOS**\\
\cline{2-5}
& MALE*** & National & 45 000 & BLOS\\
\hline
Class II & Tactical & Tactical & 10 000 & 200\\
(150 kg - 600 kg) & & Formation & &\\
\hline
\multirow{3}{*}{Class I (< 150 kg)} & Small & Tact. Unit & 5000 & 50\\
\cline{2-5}
& Mini & Tact. Subunit & 3000 & 25\\
\cline{2-5}
& Micro(fig.\ref{hornet}) & Tact. Subunit & 200 & 5\\
\hline
\end{tabular}}
\caption{UAV Classification}
\label{tab:my_label}
\end{table}
答案1
稍加努力就能让桌子变得更漂亮:
表代码中使用了宏\makegapedcell
和单位包siunitx
:
\documentclass{article}
\usepackage{geometry}
\usepackage{makecell, multirow}
\newlength\pcol
\usepackage{siunitx}
\begin{document}
\begin{table}
\centering
\setcellgapes{2pt}
\makegapedcells
\sisetup{range-phrase = --,
group-four-digits}
\settowidth\pcol{(150kg - 600kg)}
\begin{tabular}{|p{\pcol}|l|l|S[table-format=5.0]|S[table-format=3.0]|}
\hline
NATO Class
& Category
& Employment
& {\makecell{Operating\\ Altitude (ft)}}
& {\makecell{Mission\\ Radius (km)}} \\
\hline
\multirow{2.4}{=}{Class III\\ (\SI{> 600}{kg})}
& HALE* (fig.\ref{hawk})
& National & 65 000 & {BLOS**}\\
\cline{2-5}
& MALE*** & National & 45 000 & {BLOS}\\
\hline
\makecell[l]{Class II\\ (\SIrange{150}{600}{kg})}
& Tactical & \makecell[l]{Tactical\\ Formation}
& 10 000 & 200\\
\hline
\multirow{3.4}{=}{Class I\\ (\SI{< 150}{kg)}}
& Small & Tactical Unit & 5000 & 50\\
\cline{2-5}
& Mini &Tactical Subunit & 3000 & 25\\
\cline{2-5}
& Micro (fig.\ref{hornet})
& Tactical Subunit & 200 & 5\\
\hline
\end{tabular}
\caption{UAV Classification}
\label{tab:my_label}
\end{table}
\end{document}
答案2
在...的帮助下makecell
:
\documentclass{article}
\usepackage{geometry}
\usepackage{multirow}
\usepackage{makecell}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
NATO Class & Category & Employment & Operating Altitude & Mission Radius\\
& & & (ft) & (km)\\
\hline
\multirow{2}{*}{Class III (> 600 kg)} & HALE*(fig.\ref{hawk}) & National & 65 000 & BLOS**\\
\cline{2-5}
& MALE*** & National & 45 000 & BLOS\\
\hline
\makecell{Class II\\ (150 kg - 600 kg)}& Tactical & \makecell{Tactical\\ Formation} & 10 000 & 200\\
\hline
\multirow{3}{*}{Class I (< 150 kg)} & Small & Tact. Unit & 5000 & 50\\
\cline{2-5}
& Mini & Tact. Subunit & 3000 & 25\\
\cline{2-5}
& Micro(fig.\ref{hornet}) & Tact. Subunit & 200 & 5\\
\hline
\end{tabular}
\caption{UAV Classification}
\label{tab:my_label}
\end{table}
\end{document}
请注意,我还删除了,scalebox
因为这会导致整个文档的字体大小不一致。如果表格超出了文本宽度,您可以将字体大小更改为小,降低 tabcolsep 的值和/或在列标题中引入换行符。