在列格式里面使用>{\centering}m{宽度}就可以了,但是此时tabular环境要调用array宏包,并且换行不能使用\\实现,而需要\tabularnewline来换行。下列展示了如何实现一个三行两列的表格,并且cell width分别是2cm和6cm。
\documentclass{article}
\usepackage{array} %tabular需要调用array包,以便实现指定列宽。
\begin{document}
\begin{tabular}{|>{\centering}m{2cm}|>{\centering}m{6cm}|}\hline
Title & Content \tabularnewline
\hline
No man is happy but by comparison & He who knows himself best is the best \tabularnewline
\hline
This is a test to test the length of cell &lklljk \tabularnewline\hline
\end{tabular}
\end{document}
阅读(2527) | 评论(0) | 转发(0) |