[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there any way to make alternate rows of a table have a light gray
Re: Is there any way to make alternate rows of a table have a light gray background?
Tue, 8 Jun 2021 12:56:34 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1
I do not know any direct way instruct tbl and groff to color the
background of specific cells in a table.
However, I can think of two completely different workarounds (rather:
extremely ugly hacks) that could offer a solution for your specific
problem, depending on the complexity of the table (is it just a plain
table for data presentation, or does it have complex cell spans,
vertical or horizontal?) and the desired output medium.
1. If your output is not on paper, but e.g. to a browser, use mandoc to
produce the tables and place the color instructions into a css, marking
them as attributes to the table rows.
2. If your output is print AND your table model is extremely simple
(basically just running lines of data --- I remember the endless paper
pre-printed in a two-color pattern, with holed margins for the
sprocketwheel of the printer), you could also use pic to mimic your
table like this:
box ht 0.2 wid 1.0 "A" shaded "lightgray"
box ht 0.2 wid 1.0 "B"
box ht 0.2 wid 1.0 "C" shaded "green"
box ht 0.2 wid 1.0 "D"
box ht 0.2 wid 1.0 "E" shaded "lightgray"
Since you'll probably transform your data into tbl format, you could
transform it into this format as well.
3. Maybe the PostScript pundits here have ideas how to place PostScript
instructions into either the tbl code or the intermediate code before
processing to PostScript or PDF occurs.
Just a few ideas, don't know whether they are helpful at all.
PS: I tried the pic example first with 'shaded "gray"' but the boxes
turned black. The valid color names are available in ps.tmac.
On 07/06/2021 22:11, T. Kurt Bond wrote:
Is there any way to make alternate rows of a table have a light gray
Re: Is there any way to make alternate rows of a table have a light gray background?, Boss Hog, 2021/06/08