Welcome to the UK List of
TeX Frequently Asked Questions
on the Web


The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:

How to change a whole row of a table

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:


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
  Heading & Big and & Bold \\ \hline
  Meek & mild & entry      \\
  Meek & mild & entry      \\
  Strange & and & italic   \\
  Meek & mild & entry      \\ \hline

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

Distributed as part of macros/latex/required/tools (or browse the directory); catalogue entry

Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=wholerow

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.28, released on 2014-06-10.