
我想要一個表格,例如 3 列,其中前兩列將具有自然寬度,因此文字不會換行,如果整個表格大於文字寬度,則最後一列將換行。乳膠中可以嗎?
--------------------------------------- // line
| a | asfafasf | asfasfasff |
| b | saf | asafasfsafasfasfasfs |
| c | safasf | asasffsaf asfasf |
| | | asasfsafaf |
答案1
tabularx
可以用它的專欄來完成這項工作X
。我已經添加了\raggedright
這樣複雜的單字不會造成麻煩。
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{ll>{\raggedright\arraybackslash}X}
a & asfafasf & asfasfasff \\
b & saf & asafasfsafasfasfasfs \\
c & safasf & asasffsaf asfasf asasfsafaf asasfsafaf asasfsafaf asasfsafaf asasfsafaf asasfsafaf asasfsafaf asasfsafaf \\
\end{tabularx}
\end{document}