
如圖所示,表格不完整且超出了頁面範圍。我需要將其放入頁面中。因此,我需要增加行高並減少列寬。我怎樣才能做到這一點?此外,文字未居中對齊。我不明白這裡的問題。
\begin{table}[ht]
\begin{center}
\begin{tabular}{||c||c|c||c|c|c|c||}
\hline
\multirow{2}{2cm}{\textbf{Atlas Resolution}} & \multicolumn{2}{p{3cm}||}{\centering \textbf{Variant-1}} & \multicolumn{2}{p{3cm}||}{\centering \textbf{Variant-2}} & \multicolumn{2}{p{3cm}||}{\centering \textbf{Variant-3}} \\ \cline{2-7}
& \textbf{Average Render Time (ms)} & \textbf{IFPS} & \textbf{Average Render Time (ms)} & \textbf{IFPS} & \textbf{Average Render Time (ms)} & \textbf{IFPS}\\
\hline\hline
512$\times$512 & & & & & & \\
\hline
1024$\times$1024 & & & & & & \\
\hline
18432$\times$18432 & & & & & & \\
\hline
19456$\times$19456 & & & & & & \\ [1ex]
\hline
\end{tabular}
\caption{List of sizes for various resolution of Dataset-I, compressed variant Dataset-II and different slices variant Dataset-II}
\end{center}
\end{table}
\label{tab:1}
更新表:
答案1
看看,您是否可以接受以下解決方法:
\documentclass{article}
\usepackage{booktabs,makecell,multirow,tabularx}
\renewcommand\theadfont{\bfseries\normalsize}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{geometry}
\begin{document}
\begin{table}[ht]
\centering
\begin{tabularx}{\textwidth}{c L c L c L c }
\toprule
\multirow{2}{*}{\thead{Atlas\\ Resolution}}
& \multicolumn{2}{c}{\thead{Variant-1}}
& \multicolumn{2}{c}{\thead{Variant-2}}
& \multicolumn{2}{c}{\thead{Variant-3}} \\
\cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}
& \thead[b]{Average\\ Render\\ Time (ms)} & \thead[b]{IFPS}
& \thead[b]{Average\\ Render\\ Time (ms)} & \thead[b]{IFPS}
& \thead[b]{Average\\ Render\\ Time (ms)} & \thead[b]{IFPS} \\
\midrule
512$\times$512 & & & & & & \\
1024$\times$1024 & & & & & & \\
\addlinespace[2pt]
18432$\times$18432 & & & & & & \\
19456$\times$19456 & & & & & & \\
\bottomrule
\end{tabularx}
\caption{List of sizes for various resolution of Dataset-I, compressed variant Dataset-II and different slices variant Dataset-II}
\label{tab:1}
\end{table}
\end{document}
編輯:
我徹底重新設計了你的桌子。在此,我使用套件booktabs
來實現水平規則、makecell
列標題、tabularx
文字寬度上的跨度表以及列寬度的簡單確定。列標題中的字體定義為
\renewcommand\theadfont{\bfseries\normalsize}
Mico 的評論仍然是我的,很多人(其中也包括我)認為如果列標題中的字體不是粗體,表格會更美觀。這是透過使用實現的簡單實現:
\renewcommand\theadfont{\normalsize}
在這種情況下,表監視是: