Sync-to-go: update copyright for 2015
[s-roff.git] / contrib / hdtbl / examples / col_rowspan_colors.roff
blobc19d94c4f4dc4c8b5f3660bfd85b935eac4437bc
1 .ig
2 @ col_rowspan_colors.roff
4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
7 written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>.
9 This is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
14 This is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
19 You should have received a copy of the GNU General Public License
20 along with groff; see the file COPYING.  If not, write to the Free
21 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
22 02110-1301, USA.
25 .time start
26 .de color#
27 .nr # +1
28 .random#
29 .defcolor c\\n# rgb \\*[#random]
32 .de brt
33 .nr # 0
34 .color#
35 .if \\n[t*cols\\n[t*#]]/2*2=\\n[t*cols\\n[t*#]] \{ .
36 .   tmc \\n(.F:\\n(.c: cols was even (\\n[t*cols\\n[t*#]]),
37 .   nr t*cols\\n[t*#] +1
38 .   tm  increased by one col to \\n[t*cols\\n[t*#]].
39 .   t*cl \\*[width]
40 .   ie "\\*[tal]"r" .nr in\\n[t*#] -\\*[width]\"    recalculate cell widths etc.
41 .   el .if "\\*[tal]"c" .nr in\\n[t*#] -\\*[width]/2
42 .\}
43 .nr N \\n[t*cols\\n[t*#]]-1             \"      N must be even
44 .nr W 1c\"\\*[width]
45 .ds html "".TR height=\\nW" ".TD bgc=c\\n#"
46 .nr I 0 2
47 .while \\nN>=\\n+I \{ .
48 .   ds help "\\*[html]
49 .   pops * help
50 .   color#
51 .   ds html "".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
52 .   color#
53 .   as html " ".TD rowspan=\\nI bgc=c\\n#"
54 .   color#
55 .   as html " ".TR height=\\nW" ".TD rowspan=\\nI bgc=c\\n#"
56 .   color#
57 .   as html " \\*[help] ".TR height=\\nW" ".TD colspan=\\nI bgc=c\\n#"
58 .\}
59 .P1 \\*[html]
62 .pv 1.2 1.2 "" x
63 .PN 10 Text before table.
64 .in 1c
65 .PN 8 Indented text before table.
66 *** *** ***
67 .TBL width=90% border=1n csp=1n cpd=1n bgc=wheat tal=c .TR .TD
68 .TBL  border= cols=10 width=1c tal=c csp=0 cpd=0 \"cols must be odd
69 .CPTN val=b Randomly Colored Table Cells with Colspan/\%Rowspan
70 .brt
71 .ETB .ETB
72 .PN 15 Text after table.
73 .time
74 .date
75 .\"     466MHz Celeron CPU, 384MB RAM
76 .\"     WindowsXP/cygwin groff18.1:      4s
77 .\"     WindowsXP/cygwin groff19.2:      7s
78 .\"     Suse Linux 9.3 groff19.2:        1s
79 .\" s-tr-mode