line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormatTableCell; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
HTML::FormatTableCell - Format HTML Table |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require HTML::FormatTableCell; |
10
|
|
|
|
|
|
|
@ISA=qw(HTML::FormatTableCell); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
The HTML::FormatTableCell is a base class used to record information |
15
|
|
|
|
|
|
|
about a table entry as part of FormatTable processing. It is necessary |
16
|
|
|
|
|
|
|
to record information for formatting into languages such as nroff tbl |
17
|
|
|
|
|
|
|
which require formatting information ahead of the table data. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 METHODS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require 5.004; |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
58
|
|
26
|
2
|
|
|
2
|
|
9
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
829
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 $cell = new HTML::FormatTableCellNroff(%attr); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Since FormatTableCell is a base class, a derived class constructor |
31
|
|
|
|
|
|
|
such as L should be called. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
The following attributes are supported: |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
header - is a header (default is '') |
36
|
|
|
|
|
|
|
nowrap - do not wrap if defined |
37
|
|
|
|
|
|
|
rowspan - number of rows cell spans (default is 1) |
38
|
|
|
|
|
|
|
colspan - number of columns cell spans (default is 1) |
39
|
|
|
|
|
|
|
align - alignment of cell contents (default is 'left') |
40
|
|
|
|
|
|
|
valign - vertical alignment of cell (default is 'middle') |
41
|
|
|
|
|
|
|
contents - contents of cell (default is '') |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub new { |
46
|
2
|
|
|
2
|
1
|
15
|
my($class, %attr) = @_; |
47
|
|
|
|
|
|
|
|
48
|
2
|
|
50
|
|
|
71
|
my $self = bless { |
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
49
|
|
|
|
|
|
|
header => $attr{'header'} || '', |
50
|
|
|
|
|
|
|
nowrap => $attr{'nowrap'} || 'nowrap', |
51
|
|
|
|
|
|
|
rowspan => $attr{'rowspan'} || 1, |
52
|
|
|
|
|
|
|
colspan => $attr{'colspan'} || 1, |
53
|
|
|
|
|
|
|
align => $attr{'align'} || 'left', |
54
|
|
|
|
|
|
|
valign => $attr{'valign'} || 'middle', |
55
|
|
|
|
|
|
|
contents => $attr{'contents'} || '', |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
text => "", |
58
|
|
|
|
|
|
|
}, $class; |
59
|
|
|
|
|
|
|
|
60
|
2
|
|
|
|
|
9
|
return $self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 $cell->add_text($text); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Add additional contents to cell. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub add_text { |
70
|
4
|
|
|
4
|
1
|
15
|
my($self, $text) = @_; |
71
|
|
|
|
|
|
|
|
72
|
4
|
|
|
|
|
15
|
$self->{'text'} .= $text; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 $alignment = $cell->alignment(); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Return cell alignment. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub alignment { |
82
|
1
|
|
|
1
|
1
|
9
|
my($self) = @_; |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
|
|
4
|
return $self->{'align'}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 $colspan = $cell->colspan(); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Return cell colspan. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub colspan { |
94
|
1
|
|
|
1
|
1
|
7
|
my($self) = @_; |
95
|
|
|
|
|
|
|
|
96
|
1
|
|
|
|
|
8
|
return $self->{'colspan'}; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 $text = $cell->text(); |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Return cell text. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub text { |
106
|
2
|
|
|
2
|
1
|
9
|
my($self) = @_; |
107
|
|
|
|
|
|
|
|
108
|
2
|
|
|
|
|
7
|
return $self->{'text'}; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 $width = $cell->width(); |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Return cell width in characters. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub width { |
118
|
0
|
|
|
0
|
1
|
|
my($self) = @_; |
119
|
|
|
|
|
|
|
|
120
|
0
|
|
|
|
|
|
length($self->{'text'}); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 SEE ALSO |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
L, |
126
|
|
|
|
|
|
|
L, |
127
|
|
|
|
|
|
|
L, |
128
|
|
|
|
|
|
|
L |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 COPYRIGHT |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Copyright (c) 1997 Frederick Hirsch. All rights reserved. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or |
135
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 AUTHOR |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Frederick Hirsch |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
1; |
144
|
|
|
|
|
|
|
|