groff
[Top][All Lists]
Advanced

[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


From: Oliver Corff
Subject: Re: Is there any way to make alternate rows of a table have a light gray background?
Date: Tue, 8 Jun 2021 12:56:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

Hi Kurt,

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:

.PS
down
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"
.PE
~

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.

Oliver.

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
background?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]