发布时间:2010-11-10 21:50:58
文章类别:表格制作
原文地址:http://blog.sina.com.cn/s/blog_5e16f1770100mrgs.html
QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载
前述文章在:http://blog.sina.com.cn/s/blog_5e16f1770100gi3m.html
如何在固定列宽的表格中,即p{3cm},让表格内容居中或者居右呢(默认是居左的)?
参看文章:http://blog.sina.com.cn/s/blog_5e16f1770100mrgu.html
但是,我想让固定列宽的内容既有居左又有居右,该如何实现呢?
参看如下示例:

代码如下:
\documentclass{article}
\usepackage{array}
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\begin{document}
\begin{tabular}{cp{1in}}
xxx & \PreserveBackslash\raggedright
yyy & \PreserveBackslash\raggedleft
\end{tabular}
\end{document}
这也只是一种方案,若您有更好的方案,欢迎提供!
本文参考:http://math.ecnu.edu.cn/~jypan/Teaching/Latex/faq/TeX_tips.htm#sec21
发表评论 取消回复