发布时间:2010-11-15 14:46:06
文章类别:表格制作
原文地址:http://blog.sina.com.cn/s/blog_5e16f1770100mvtd.html
QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载
【解决方案】
方案一:我们可以定义自己的表格线,可以任意指定其宽度如:
\makeatletter
\def\hlinew#1{%
\makeatother%在正文中的用法为
%不过上面的命令\hlinewd不能与longtable正常工作
使用示例:
\begin{tabular}{|l||*{4}{c|}}\hlinew{1pt}
Room With a Long Name &&&&\\\hline
Auditorium &&&&\\\hline
Seminar Room &&&&\\\hline
\end{tabular}
效果图:

这是比较底层的方法。我们已经有更为高级的方法来实现。
方案二:使用makecell宏包来定制表格线,这个包提供了\Xcline
\begin{tabular}{!{\vrule width1.2pt}c
!{\vrule width1.2pt}c|c
!{\vrule width1.2pt}}
\Xhline{1.2pt}
\multirowthead{4}{First Column head}&
\multicolumn{2}{c!{\vrule width1.2pt}}{\thead{Multicolumn head}}\\
\Xcline{2-3}{1.2pt}
& \thead{Second \\multlined \\ column head} &
\thead{Third \\ column head}\\
\Xhline{1.2pt}
Cell text & A &\multirowcell{4}{28--31}\\
\Xhline{1.2pt}
\end{tabular}
示例为:

另外,这个宏包还提供了一组命令,可使表格中列数据单独定位:居中、靠左或靠右,可将某一列标题旋转90度,可在单元格中划对角线,还可设定表格线段的粗细等。
参看:
http://www.ctan.org/tex-archive/macros/latex/contrib/makecell/makecell.pdf
发表评论 取消回复