Each cell of a table is set in a box, so that a change of font style (or whatever) only lasts to the end of the cell. If one has a many-celled table, or a long one which needs lots of rows emphasising, putting a font style change command in every cell will be impossibly tedious.

With the array package, you can define column modifiers which will change the font style for a whole column. However, with a bit of subtlety, one can make such modifiers affect rows rather than columns. So, we set things up by:

\usepackage{array}
\newcolumntype{$}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}

Now, we put ‘$’ before the first column specifier; and we put ‘’ before the modifiers of subsequent ones. We then use \rowstyle at the start of each row we want to modify:

\begin{tabular}{|$l|^l|^l|}   \hline
\rowstyle{\bfseries}
Heading & Big and & Bold \\ \hline
Meek & mild & entry \\
Meek & mild & entry \\
\rowstyle{\itshape}
Strange & and & italic \\
Meek & mild & entry \\ \hline
\end{tabular}

The array package works with several other tabular-like environments from other packages (for example longtable), but unfortunately this trick won’t always work.

最新文章

  1. HTML之CSS学习
  2. MS Sql Server 数据库或表修复(Log日志文件损坏的修复方法)
  3. PHP慢脚本日志和Mysql的慢查询日志
  4. wpf前端设计
  5. 【nginx运维基础(5)】Nginx的location攻略
  6. UVA - 297 Quadtrees (四分树)
  7. c语言学习之基础知识点介绍(十二):结构体的介绍
  8. 使用dom4j对xml文件进行增删改查
  9. 百度劫持js代码
  10. [luogu P1967][NOIp2013] 货车运输
  11. 使用PHP文件锁写一个多个请求同时并发写入一个文件,要求不脏读、数据不丢失
  12. Android studio打开项目一直卡住
  13. 优化之Joiner组件
  14. ContextLoaderListener可以不写嘛?
  15. linux 取消笔记本触摸键
  16. [py][mx]django处理登录逻辑
  17. 注册表的作用、bat文件中REG ADD命令添加注册表项以及bat
  18. 在Unity中查找缺失的引用
  19. Cloudrea manager5安装CDH5文档
  20. 170808、生成为CVS文件

热门文章

  1. JVM(四) 垃圾回收
  2. shrio学习笔记
  3. QT 创建本地数据库(SQLite数据库)存储数据
  4. PAT(B) 1063 计算谱半径(Java)
  5. littleFS在RT1052移植笔记
  6. 写Markdown博客时遇到的一些问题
  7. linux下的打包与解包的简单总结
  8. 在论坛中出现的比较难的sql问题:30(row_number函数 物料组合问题)
  9. Datatable批量导入到表
  10. Java帖子