Re: table with double entries using \rowcolors from xcolor
- From: Piet van Oostrum <piet@xxxxxxxx>
- Date: Wed, 04 Jan 2006 12:54:39 +0100
>>>>> jlr_0@xxxxxxxxx (j) wrote:
>j> I want to build a table where each row holds double entries (pairs
>j> [a1,a2]; [b1,b2]; etc.) that are
>j> vertically placed, like this:
>j> ----------------
>j> | a1 | b1 | c1 |
>j> | a2 | b2 | c2 |
>j> |--------------|
>j> | d1 | e1 | f1 |
>j> | d2 | e2 | f2 |
>j> |--------------|
>j> | g1 | h1 | i1 |
>j> | g2 | h2 | i2 |
>j> ----------------
>j> I could split an entry on two different rows in order to obtain such a
>j> table:
>j> \hline
>j> a1 & b1 & c1 \\
>j> a2 & b2 & c2 \\
>j> ...
>j> but this is not convenient because I want to keep handling pairs and
>j> not just one element of a pair.
>j> I could also use the \multirow command but this is awkward too since
>j> all entries are multirows.
>j> Besides, I want my tables to have gray background on every other row.
>j> But if I use the \rowcolors command from the xcolor package I
>j> absolutely need to have each double entry placed in one single row.
\newcommand\D[1]{\begin{tabular}{@{}c@{}}#1\end{tabular}}
\begin{tabular}{|c|c|c|}
\hline
\D{a1\\a2} & \D{b1\\b2} & \D{c1\\c2}\\
\hline
\D{d1\\d2} & \D{e1\\e2} & \D{f1\\f2}\\
\hline
\end{tabular}
Unfortunately \rowcolor doesn't propagate properly into the inner tabulars
(the topleft cell of each double row gets black). Probably David Carlisle
knows how to repair this.
--
Piet van Oostrum <piet@xxxxxxxx>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@xxxxxxxxxxxxxx
.
- Follow-Ups:
- References:
- Prev by Date: Re: alltt bold problem
- Next by Date: Re: Number of page
- Previous by thread: table with double entries using \rowcolors from xcolor
- Next by thread: Re: table with double entries using \rowcolors from xcolor
- Index(es):
Relevant Pages
|
|