【发布时间】:2019-12-16 21:57:43
【问题描述】:
我尝试将乳胶表的第一列中的文本垂直居中,而其他列的文本长度未知。其他列应顶部对齐。
我已经尝试过使用 tabular、tabularx、tabu 表环境。我在互联网上找到的所有垂直居中的方法都是使用基线或某种多行环境。
多行:不工作,因为未知的行数会在固定宽度的列中生成长文本。
基线:不起作用,因为所有其他列都应该顶部对齐。
\documentclass{article}
\begin{document}
\begin{tabular} {| p{2cm} p{2cm} p{2cm} |}
\hline
centered & This is a long top aligned text, dynamically length. & This is a long top aligned text, much longer than the previous one...or shorter. Who knows what text length is given to me in my new environment. \\
\hline
\end{tabular}
\end{document}
我希望文本“居中”在该行中垂直居中。
【问题讨论】:
标签: latex