summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-wholerow.html
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-wholerow.html')
-rw-r--r--Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-wholerow.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-wholerow.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-wholerow.html
new file mode 100644
index 00000000000..a4b39068e90
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-wholerow.html
@@ -0,0 +1,50 @@
+<head>
+<title>UK TeX FAQ -- question label wholerow</title>
+</head><body>
+<h3>How to change a whole row of a table</h3>
+<p/>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.
+<p/>With the <i>array</i> package, you can define column modifiers
+which will change the font style for a whole <em>column</em>. However,
+with a bit of subtlety, one can make such modifiers affect rows rather
+than columns. So, we set things up by:
+<blockquote>
+
+<pre>
+\usepackage{array}
+\newcolumntype{$}{&gt;{\global\let\currentrowstyle\relax}}
+\newcolumntype{^}{&gt;{\currentrowstyle}}
+\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
+ #1\ignorespaces
+}
+</pre>
+</blockquote><p>
+Now, we put &lsquo;<code>$</code>&rsquo; before the first column specifier; and we
+put &lsquo;<code>\textasciicircum</code>&rsquo;
+before the modifiers of subsequent ones. We then use <code>\</code><code>rowstyle</code> at
+the start of each row we want to modify:
+<blockquote>
+<pre>
+\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}
+</pre>
+</blockquote><p>
+The <i>array</i> package works with several other
+<code>tabular</code>-like environments from other packages (for
+example <code>longtable</code>), but unfortunately this trick won&rsquo;t
+always work.
+<dl>
+<dt><tt><i>array.sty</i></tt><dd>Distributed as part of <a href="ftp://cam.ctan.org/tex-archive/macros/latex/required/tools.zip">macros/latex/required/tools</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/required/tools.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/tools/">browse</a>)
+</dl>
+<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=wholerow">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=wholerow</a>
+</body>