4 col_rowspan_colors.roff
6 This file is part of groff, the GNU roff type-setting system.
8 Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
9 written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>.
11 groff is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free
13 Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 groff is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
30 .defcolor c\\n# rgb \\*[#random]
36 .if \\n[t*cols\\n[t*#]]/2*2=\\n[t*cols\\n[t*#]] \{ .
37 . tmc \\n(.F:\\n(.c: cols was even (\\n[t*cols\\n[t*#]]),
38 . nr t*cols\\n[t*#] +1
39 . tm increased by one col to \\n[t*cols\\n[t*#]].
41 . ie "\\*[tal]"r" .nr in\\n[t*#] -\\*[width]\" recalculate cell widths etc.
42 . el .if "\\*[tal]"c" .nr in\\n[t*#] -\\*[width]/2
44 .nr N \\n[t*cols\\n[t*#]]-1 \" N must be even
46 .ds html "".TR height=\\nW" ".TD bgc=c\\n#"
48 .while \\nN>=\\n+I \{ .
52 . ds html "".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
54 . as html " ".TD rowspan=\\nI bgc=c\\n#"
56 . as html " ".TR height=\\nW" ".TD rowspan=\\nI bgc=c\\n#"
58 . as html " \\*[help] ".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
64 .PN 10 Text before table.
66 .PN 8 Indented text before table.
68 .TBL width=90% border=1n csp=1n cpd=1n bgc=wheat tal=c .TR .TD
69 .TBL border= cols=10 width=1c tal=c csp=0 cpd=0 \"cols must be odd
70 .CPTN val=b Randomly Colored Table Cells with Colspan/\%Rowspan
73 .PN 15 Text after table.
76 .\" 466MHz Celeron CPU, 384MB RAM
77 .\" WindowsXP/cygwin groff18.1: 4s
78 .\" WindowsXP/cygwin groff19.2: 7s
79 .\" Suse Linux 9.3 groff19.2: 1s