具有動態容量的表格列

具有動態容量的表格列

創建這樣的表格列的最簡單方法是什麼?在此輸入影像描述

答案1

我想你可能想考慮使用 LaTeX 的p列類型。它 (a) 允許您指定最大可用寬度(6cm如下例所示),(b) 如果單元格內容超出可用寬度,則使LaTeX 自動插入換行符,(c) 完全對齊每個單元格的內容(就像TeX 一樣)與普通段落相同)。使用\multicolumn{1}{...}{...}語句p根據需要覆寫列類型(例如,對於標題儲存格)。

在此輸入影像描述

\documentclass{article}
\usepackage{array} % for "\extrarowheight" length variable
\setlength\extrarowheight{2pt} % optional
\begin{document}
\begin{tabular}{|p{6cm}|p{6cm}|}
\hline
\multicolumn{1}{|c|}{Prokaryotic Cells} &
\multicolumn{1}{c|}{Eukaryotic Cells} \\
\hline
Very minute in size & Fairly large in size \\
\hline
Nuclear region (nucleoid) not surrounded by a nuclear membrane & 
Nuclear region surrounded by a nuclear membrane\\
\hline
\dots & \dots \\
\hline
\end{tabular}
\end{document}

相關內容