lib/HTML/Object/DOM/Element/TableRow.pm

filter: Statementstmt 69.7% 83 / 119 Branchbran 38.0% 19 / 50 Conditioncond 36.6% 11 / 30 MC/DCmcdc 22.2% 4 / 18 Subroutinesub 70.3% 19 / 27 Podpod 100% 14 / 14 totaltotal 58.1% 150 / 258 CC 38 SCAR 34.0
CC
38
Cov
57%
deleteCell
90.0
insertCell
70.4
cells
6.0
CRAP 29.8
« lib/HTML/Object/DOM/Element/TableSection.pm ↑ Summary blib/lib/HTML/Object/DOM/CharacterData.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Element/TableRow.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2022/01/07
7 ## Modified 2022/09/18
8 ## All rights reserved
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::DOM::Element::TableRow;
15 BEGIN
16 {
17 2 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶ use parent qw( HTML::Object::DOM::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶ use HTML::Object::DOM::Element::Shared qw( :tablerow );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 our $VERSION = 'v0.2.0';
24 };
25  
26 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 6 ▶ my $self = shift( @_ );
Subroutine init: called CC=4 SCAR=13.9
Pod documented
32 6 $self->{_init_strict_use_sub} = 1;
33 6 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 6 6
34 6 ▶ $self->{tag} = 'tr' if( !defined( $self->{tag} ) || !CORE::length( "$self->{tag}" ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"tag"} and length qq[$self->{"tag"}] 1 5 6
Condition66%2/3
defined $self->{"tag"} and length qq[$self->{"tag"}]
!ll&&!rl&&r
015
MC/DC50%1/2
defined $self->{"tag"} and length qq[$self->{"tag"}]
defined $self->{"tag"} length qq[$self->{"tag"}]
Truth table66%2/3
A and B
A= defined $self->{"tag"}B= length qq[$self->{"tag"}]
ABresult
0X0
100
111
35 6 $self->{_row_reset} = 1;
36 my $callback = sub
37 {
38 12 ▶ my $def = shift( @_ );
Subroutine __ANON__: called CC=3 SCAR=11.0
39 # Our children were modified from outside our package.
40 # We need to check if it affects our rows and reset the cache accordingly
41 12 ▶ unless( $def->{caller}->[0] eq ref( $self ) ||
Branch: 1 branch
BranchTrueFalseTotal
unless ($def->{"caller"}[0] eq ref $self or $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table") 11 1 12
Condition66%2/3
$def->{"caller"}[0] eq ref $self or $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
l!l&&r!l&&!r
1011
MC/DC50%1/2
$def->{"caller"}[0] eq ref $self or $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
$def->{"caller"}[0] eq ref $self $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
Truth table66%2/3
A or B
A= $def->{"caller"}[0] eq ref $selfB= $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
ABresult
1X1
011
000
42 $def->{caller}->[0] eq 'HTML::Object::DOM::Element::Table' )
43 {
44 11 $self->reset(1);
45 }
46 12 return(1);
47 6 };
48 6 $self->children->callback( add => $callback );
49 6 $self->children->callback( remove => $callback );
50 6 return( $self );
51 }
52  
53 # Note: deprecated property align is inherited
54  
55 # Note: deprecated property bgColor
56 0 ▶sub bgColor : lvalue { return( shift->_set_get_property( 'bgcolor', @_ ) ); }
Subroutine bgColor: not called CC=1 SCAR=6.9
Pod documented
57  
58 0 ▶sub bgcolor : lvalue { return( shift->bgColor( @_ ) ); }
Subroutine bgcolor: not called CC=1 SCAR=6.9
Pod documented
59  
60 # Note: property cells read-only
61 sub cells
62 {
63 64 ▶ my $self = shift( @_ );
Subroutine cells: called CC=6 SCAR=18.0
Pod documented
64 64 ▶ return( $self->{_row_cells} ) if( $self->{_row_cells} && !$self->_is_row_reset );
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"_row_cells"} and not $self->_is_row_reset 3 61 64
Condition100%3/3
$self->{"_row_cells"} and not $self->_is_row_reset
!ll&&!rl&&r
6553
MC/DC100%2/2
$self->{"_row_cells"} and not $self->_is_row_reset
$self->{"_row_cells"} not $self->_is_row_reset
Truth table100%3/3
A and not(B)
A= $self->{"_row_cells"}B= not $self->_is_row_reset
ABresult
0X0
100
111
65 61 ▶ my $list = $self->children->grep(sub{ $self->_is_a( $_ => 'HTML::Object::DOM::Element::TableCell' ) });
Subroutine __ANON__: called CC=1 SCAR=0.0
66 # The content of the collection is refreshed, but the collection object itself does not change, so the user can poll it
67 61 ▶ unless( $self->{_row_cells} )
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"_row_cells"}) 6 55 61
68 {
69 6 ▶ $self->_load_class( 'HTML::Object::DOM::Collection' ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->_load_class("HTML::Object::DOM::Collection") or return $self->pass_error 0 6 6
70 6 ▶ $self->{_row_cells} = HTML::Object::DOM::Collection->new ||
Condition50%1/2
'HTML::Object::DOM::Collection'->new || (return $self->pass_error('HTML::Object::DOM::Collection'->error))
l!l
60
MC/DC0%0/1
'HTML::Object::DOM::Collection'->new || (return $self->pass_error('HTML::Object::DOM::Collection'->error))
'HTML::Object::DOM::Collection'->new
Truth table50%1/2
A
A= 'HTML::Object::DOM::Collection'->new
Aresult
11
00
71 return( $self->pass_error( HTML::Object::DOM::Collection->error ) );
72 }
73 61 $self->{_row_cells}->set( $list );
74 61 $self->_remove_row_reset;
75 61 return( $self->{_row_cells} );
76 }
77  
78 # Note: deprecated property ch
79 0 ▶sub ch : lvalue { return( shift->_set_get_property( 'ch', @_ ) ); }
Subroutine ch: not called CC=1 SCAR=6.9
Pod documented
80  
81 # Note: deprecated property chOff
82 0 ▶sub chOff : lvalue { return( shift->_set_get_property( 'choff', @_ ) ); }
Subroutine chOff: not called CC=1 SCAR=6.9
Pod documented
83  
84 0 ▶sub choff : lvalue { return( shift->chOff( @_ ) ); }
Subroutine choff: not called CC=1 SCAR=6.9
Pod documented
85  
86 sub deleteCell
87 {
88 0 ▶ my $self = shift( @_ );
Subroutine deleteCell: not called CC=9 SCAR=45.0
Pod documented
89 0 my $pos = shift( @_ );
90 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
unless defined $pos and $self->_is_integer($pos) 0 0 0
Condition0%0/5
defined $pos and $self->_is_integer($pos)
!ll&&!rl&&r
000
$pos // ""
l!l
00
MC/DC0%0/2
defined $pos and $self->_is_integer($pos)
defined $pos $self->_is_integer($pos)
MC/DC0%0/1
$pos // ""
$pos
Truth table0%0/3
A and B
A= defined $posB= $self->_is_integer($pos)
ABresult
0X0
100
111
Truth table0%0/2
A
A= $pos
Aresult
11
00
91 message => "Value provided (" . overload::StrVal( $pos // '' ) . ") is not an integer.",
92 class => 'HTML::Object::IndexSizeError',
93 }) ) if( !defined( $pos ) || !$self->_is_integer( $pos ) );
94 0 my $cells = $self->cells;
95 0 my $size = $cells->cells;
96 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
if $pos > $size 0 0 0
97 message => "Value provided ($pos) is greater than the zero-based number of cells available (${size}).",
98 class => 'HTML::Object::IndexSizeError',
99 }) ) if( $pos > $size );
100 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
if $pos < 0 and abs $pos > $size 0 0 0
Condition0%0/3
$pos < 0 and abs $pos > $size
!ll&&!rl&&r
000
MC/DC0%0/2
$pos < 0 and abs $pos > $size
$pos < 0 abs $pos > $size
Truth table0%0/3
A and B
A= $pos < 0B= abs $pos > $size
ABresult
0X0
100
111
101 message => "Value provided ($pos) is lower than the zero-based number of cells available (${size}). If you want to specify a negative index, it must be between -1 and -${size}",
102 class => 'HTML::Object::IndexSizeError',
103 }) ) if( $pos < 0 && abs( $pos ) > $size );
104 0 ▶ $pos = ( $cells->length + $pos ) if( $pos < 0 );
Branch: 1 branch
BranchTrueFalseTotal
if $pos < 0 0 0 0
105 0 my $elem = $cells->index( $pos );
106 0 my $children = $self->children;
107 0 my $kid_pos = $children->pos( $elem );
108 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
unless defined $kid_pos 0 0 0
109 message => "Unable to find the cell element among this row children!",
110 class => 'HTML::Object::HierarchyRequestError',
111 }) ) if( !defined( $kid_pos ) );
112 0 $children->splice( $kid_pos, 1 );
113 0 $elem->parent( undef );
114 0 $self->reset(1);
115 0 return( $elem );
116 }
117  
118 sub insertCell
119 {
120 1 ▶ my $self = shift( @_ );
Subroutine insertCell: called CC=14 SCAR=42.5
Pod documented
121 1 my $pos = shift( @_ );
122 1 my $cells = $self->cells;
123 1 my $size = $cells->size;
124 1 ▶ if( defined( $pos ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $pos) 0 1 1
125 {
126 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_is_integer($pos) 0 0 0
Condition0%0/2
$pos // ""
l!l
00
MC/DC0%0/1
$pos // ""
$pos
Truth table0%0/2
A
A= $pos
Aresult
11
00
127 message => "Value provided (" . overload::StrVal( $pos // '' ) . ") is not an integer.",
128 class => 'HTML::Object::IndexSizeError',
129 }) ) if( !$self->_is_integer( $pos ) );
130 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
if $pos > $size 0 0 0
131 message => "Value provided ($pos) is greater than the zero-based number of cells available (${size}).",
132 class => 'HTML::Object::IndexSizeError',
133 }) ) if( $pos > $size );
134 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
if $pos < 0 and abs $pos > $size 0 0 0
Condition0%0/3
$pos < 0 and abs $pos > $size
!ll&&!rl&&r
000
MC/DC0%0/2
$pos < 0 and abs $pos > $size
$pos < 0 abs $pos > $size
Truth table0%0/3
A and B
A= $pos < 0B= abs $pos > $size
ABresult
0X0
100
111
135 message => "Value provided ($pos) is lower than the zero-based number of cells available (${size}). If you want to specify a negative index, it must be between -1 and -${size}",
136 class => 'HTML::Object::IndexSizeError',
137 }) ) if( $pos < 0 && abs( $pos ) > $size );
138 0 ▶ $pos = ( $cells->length + $pos ) if( $pos < 0 );
Branch: 1 branch
BranchTrueFalseTotal
if $pos < 0 0 0 0
139 }
140 1 ▶ $self->_load_class( 'HTML::Object::DOM::Element::TableCell' ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->_load_class("HTML::Object::DOM::Element::TableCell") or return $self->pass_error 0 1 1
141 1 my $children = $self->children;
142 1 ▶ my $cell = HTML::Object::DOM::Element::TableCell->new( @_ ) ||
Condition50%1/2
'HTML::Object::DOM::Element::TableCell'->new(@_) || (return $self->pass_error('HTML::Object::DOM::Element::TableCell'->error))
l!l
10
MC/DC0%0/1
'HTML::Object::DOM::Element::TableCell'->new(@_) || (return $self->pass_error('HTML::Object::DOM::Element::TableCell'->error))
'HTML::Object::DOM::Element::TableCell'->new(@_)
Truth table50%1/2
A
A= 'HTML::Object::DOM::Element::TableCell'->new(@_)
Aresult
11
00
143 return( $self->pass_error( HTML::Object::DOM::Element::TableCell->error ) );
144 1 $cell->close;
145 # A position was provided
146 1 ▶ if( defined( $pos ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $pos) { } 0 1 1
147 {
148 # ..., but there are no cells yet
149 0 ▶ if( $cells->is_empty )
Branch: 1 branch
BranchTrueFalseTotal
if ($cells->is_empty) { } 0 0 0
150 {
151 0 $children->push( $cell );
152 }
153 else
154 {
155 0 my $elem = $cells->index( $pos );
156 0 ▶ return( $self->error({
Branch: 1 branch
BranchTrueFalseTotal
unless defined $elem 0 0 0
157 message => "No element could be found at row index $pos",
158 class => 'HTML::Object::HierarchyRequestError',
159 }) ) if( !defined( $elem ) );
160 0 my $kid_pos = $children->pos( $elem );
161 0 ▶ if( !defined( $kid_pos ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $kid_pos) 0 0 0
162 {
163 0 return( $self->error({
164 message => "Could not find a value at offset $pos (translated to $kid_pos among the row children) amazingly enough.",
165 class => 'HTML::Object::HierarchyRequestError',
166 }) );
167 }
168 0 $children->splice( $kid_pos, 0, $cell );
169 }
170 }
171 # otherwise, there are already other cells directly under <tr> and the new cell is just added at the end of the row.
172 else
173 {
174 1 $children->push( $cell );
175 }
176 1 $cell->parent( $self );
177 1 $self->reset(1);
178 1 return( $cell );
179 }
180  
181 sub reset
182 {
183 228 ▶ my $self = shift( @_ );
Subroutine reset: called CC=2 SCAR=6.9
Pod documented
184 228 ▶ if( scalar( @_ ) )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_) 61 167 228
185 {
186 61 $self->_reset_row;
187 61 return( $self->SUPER::reset( @_ ) );
188 }
189 167 return( $self );
190 }
191  
192 # Note: property rowIndex read-only
193 sub rowIndex
194 {
195 1 ▶ my $self = shift( @_ );
Subroutine rowIndex: called CC=2 SCAR=7.0
Pod documented
196 1 ▶ my $parent = $self->parent || return;
Condition50%1/2
$self->parent || (return)
l!l
10
MC/DC0%0/1
$self->parent || (return)
$self->parent
Truth table50%1/2
A
A= $self->parent
Aresult
11
00
197 1 my $siblings = $parent->children;
198 1 my $pos = $siblings->pos( $self );
199 1 return( $pos );
200 }
201  
202 # Note: property sectionRowIndex read-only
203 sub sectionRowIndex
204 {
205 1 ▶ my $self = shift( @_ );
Subroutine sectionRowIndex: called CC=3 SCAR=12.0
Pod documented
206 1 ▶ my $parent = $self->parent || return;
Condition50%1/2
$self->parent || (return)
l!l
10
MC/DC0%0/1
$self->parent || (return)
$self->parent
Truth table50%1/2
A
A= $self->parent
Aresult
11
00
207 1 ▶ if( $self->_is_a( $parent => 'HTML::Object::DOM::Element::TableSection' ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_is_a($parent, "HTML::Object::DOM::Element::TableSection")) 1 0 1
208 {
209 1 return( $parent->children->pos( $self ) );
210 }
211 0 return;
212 }
213  
214 # Note: deprecated property vAlign
215 0 ▶sub vAlign : lvalue { return( shift->_set_get_property( 'valign', @_ ) ); }
Subroutine vAlign: not called CC=1 SCAR=6.9
Pod documented
216  
217 0 ▶sub valign : lvalue { return( shift->vAlign( @_ ) ); }
Subroutine valign: not called CC=1 SCAR=6.9
Pod documented
218  
219 58 ▶sub _is_row_reset { return( CORE::length( shift->{_row_reset} ) ); }
Subroutine _is_row_reset: called CC=1 SCAR=0.0
220  
221 61 ▶sub _remove_row_reset { return( CORE::delete( shift->{_row_reset} ) ); }
Subroutine _remove_row_reset: called CC=1 SCAR=0.0
222  
223 sub _reset_row
224 {
225 61 ▶ my $self = shift( @_ );
Subroutine _reset_row: called CC=3 SCAR=11.0
226 61 $self->{_row_reset}++;
227 # Force it to recompute
228 61 $self->cells;
229 61 ▶ if( my $parent = $self->parent )
Branch: 1 branch
BranchTrueFalseTotal
if (my $parent = $self->parent) 46 15 61
230 {
231 46 ▶ $parent->_reset_section if( $parent->can( '_reset_section' ) );
Branch: 1 branch
BranchTrueFalseTotal
if $parent->can("_reset_section") 46 0 46
232 }
233 61 return( $self );
234 }
235  
236 2 1;
237 # NOTE: POD
238 __END__
239  
240 =encoding utf-8
241  
242 =head1 NAME
243  
244 HTML::Object::DOM::Element::TableRow - HTML Object DOM TableRow Class
245  
246 =head1 SYNOPSIS
247  
248 use HTML::Object::DOM::Element::TableRow;
249 my $tablerow = HTML::Object::DOM::Element::TableRow->new ||
250 die( HTML::Object::DOM::Element::TableRow->error, "\n" );
251  
252 =head1 VERSION
253  
254 v0.2.0
255  
256 =head1 DESCRIPTION
257  
258 This interface provides special properties and methods (beyond the L<HTML::Object::DOM::Element> interface it also has available to it by inheritance) for manipulating the layout and presentation of rows (i.e. C<tr>) in an HTML table.
259  
260 =head1 INHERITANCE
261  
262 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+
263 | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::TableRow |
264 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+
265  
266 =head1 PROPERTIES
267  
268 Inherits properties from its parent L<HTML::Object::DOM::Element>
269  
270 =head2 cells
271  
272 Read-only.
273  
274 Returns a L<collection|HTML::Object::DOM::Collection> containing the cells in the row, but only the ones directly under the row element.
275  
276 Note that for performance improvement, the collection is cached until changes are made that would affect the results.
277  
278 Example:
279  
280 <table id="myTable1">
281 <tr>
282 <td>
283 <table id="myTable2">
284 <tr><td></td></tr>
285 </table>
286 </td>
287 <td></td>
288 </tr>
289 </table>
290  
291 say getElementById('myTable1')->rows->[0]->cells->length; # 2
292 say getElementById('myTable2')->rows->[0]->cells->length; # 1
293  
294 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/cells>
295  
296 =head2 rowIndex
297  
298 Read-only.
299  
300 Returns a long value which gives the logical position of the row within the entire table. If the row is not part of a table, returns C<undef> (C<-1> under JavaScript).
301  
302 Example:
303  
304 <table>
305 <thead>
306 <tr><th>Item</th> <th>Price</th></tr>
307 </thead>
308 <tbody>
309 <tr><td>Bananas</td> <td>$2</td></tr>
310 <tr><td>Oranges</td> <td>$8</td></tr>
311 <tr><td>Top Sirloin</td> <td>$20</td></tr>
312 </tbody>
313 <tfoot>
314 <tr><td>Total</td> <td>$30</td></tr>
315 </tfoot>
316 </table>
317  
318 Another example:
319  
320 my $rows = $doc->querySelectorAll('tr');
321  
322 $rows->forEach(sub
323 {
324 my $row = shift( @_ );
325 my $z = $doc->createElement('td');
326 $z->textContent = "(row #" . $row->rowIndex . ")";
327 row->appendChild($z);
328 });
329  
330 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/rowIndex>
331  
332 =head2 sectionRowIndex
333  
334 Read-only.
335  
336 Returns a long value which gives the logical position of the row within the table section it belongs to. If the row is not part of a section, returns C<undef> (C<-1> under JavaScript).
337  
338 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/sectionRowIndex>
339  
340 =head1 METHODS
341  
342 Inherits methods from its parent L<HTML::Object::DOM::Element>
343  
344 =head2 deleteCell
345  
346 Removes the cell corresponding to the C<index> given in parameter. If the C<index> value is C<-1> the last cell is removed; if it smaller than C<-1> or greater than the amount of cells in the collection, an C<HTML::Object::IndexSizeError> is returned.
347  
348 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/deleteCell>
349  
350 =head2 insertCell
351  
352 Returns an L<HTML::Object::DOM::Element::TableCell> representing a new cell of the table. It inserts it in the L<cells collection|/cells> immediately before a C<td> or C<th> element at the given C<index> position, if any was provided.
353  
354 If the C<index> is not given or is C<-1>, the new cell is appended to the collection. If the C<index> is smaller than C<-1>, it will start that far back from the end of the collection array. If C<index> is greater than the number of cells in the collection, an C<HTML::Object::IndexSizeError> error is returned.
355  
356 Example:
357  
358 <table id="my-table">
359 <tr><td>Row 1</td></tr>
360 <tr><td>Row 2</td></tr>
361 <tr><td>Row 3</td></tr>
362 </table>
363  
364 sub addRow
365 {
366 my $tableID = shift( @_ );
367 # Get a reference to the table
368 my $tableRef = $doc->getElementById( $tableID );
369  
370 # Insert a row at the end of the table
371 my $newRow = $tableRef->insertRow( -1 );
372  
373 # Insert a cell in the row at index 0
374 my $newCell = $newRow->insertCell( 0 );
375  
376 # Append a text node to the cell
377 my $newText = $doc->createTextNode('New bottom row');
378 $newCell->appendChild( $newText );
379 }
380  
381 # Call addRow() with the table's ID
382 addRow( 'my-table' );
383  
384 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/insertCell>
385  
386 =head1 DEPRECATED PROPERTIES
387  
388 =head2 align
389  
390 Is a string containing an enumerated value reflecting the align attribute. It indicates the alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", and "center".
391  
392 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/align>
393  
394 =head2 bgColor
395  
396 Is a string containing the background color of the cells. It reflects the obsolete bgcolor attribute.
397  
398 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/bgColor>
399  
400 =head2 bgcolor
401  
402 Alias for L</bgColor>
403  
404 =head2 ch
405  
406 Is a string containing one single character. This character is the one to align all the cell of a column on. It reflects the char and default to the decimal points associated with the language, e.g. '.' for English, or ',' for French. This property was optional and was not very well supported.
407  
408 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/ch>
409  
410 =head2 chOff
411  
412 Is a string containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by L<HTML::Object::DOM::Element::C<TableRow>>.ch. This property was optional and was not very well supported.
413  
414 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/chOff>
415  
416 =head2 choff
417  
418 Alias for L</chOff>
419  
420 =head2 reset
421  
422 When called, this will set a boolean value indicating the cached data must be recomputed. This allow the saving of computational power,
423  
424 =head2 vAlign
425  
426 Is a string representing an enumerated value indicating how the content of the cell must be vertically aligned. It reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline".
427  
428 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/vAlign>
429  
430 =head2 valign
431  
432 Alias for L</vAlign>
433  
434 =head1 AUTHOR
435  
436 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
437  
438 =head1 SEE ALSO
439  
440 L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement>, L<Mozilla documentation on tablerow element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tablerow>
441  
442 =head1 COPYRIGHT & LICENSE
443  
444 Copyright(c) 2022 DEGUEST Pte. Ltd.
445  
446 All rights reserved
447  
448 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
449  
450 =cut
« lib/HTML/Object/DOM/Element/TableSection.pm ↑ Summary blib/lib/HTML/Object/DOM/CharacterData.pm »