法一:
- \begin{tabular}{m{5cm}}
法二:
- \begin{tabular}{p{0.9\columnwidth}}
- nrows 設定所占用的行數。
- bigstructs 此為可選項,主要是在你使用了 bigstruct 宏包時使用。
- width 設定該欄文本的寬度。如果想讓 LaTeX 自行決定文本的寬度,則用 * 即可。
- fixup 此為可選項,主要用來調整文本的垂直位置。
- text 所要排版的文本。可用 \\ 來強迫換行。
法四:
- /newcommand{/tabincell}[2]{/begin{tabular}{@{}#1@{}}#2/end{tabular}}
然后使用&/tabincell{c}{}&就可以在表格中自動換行
比如這么用
- /begin{tabular}{|c|c|}
- /hline
- 1 & the first line //
- /hline
- 2 & /tabincell{c}{haha// heihei//zeze} //
- /hline
- /end{tabular}
- /begin{tabular}{|c|c|}
- /hline
- 1 & the first line //
- /hline
- 2 & /tabincell{c}{haha// heihei//zeze} //
- /hline
- /end{tabular}