Subject: | getTable gets tbodies after the first wrong. |
my $table = new HTML::Table
$table->setSectionId('tbody', 0, 'sec0');
$table->addSectionRow('tbody', 0, 'hello');
$table->setSectionId('tbody', 1, 'sec1');
$table->addSectionRow('tbody', 1, 'byebye');
print $table;
Produces ..
<tbody id="sec0">
<tr>
<td>hello</td>
</tr>
</tbody>
<tbody id="sec0">
<tr>
<td>byebye</td>
</tr>
</tbody>
This is not surprising, as the code says
================================================
my $num_sections = @{$self->{tbody}} - 1;
for my $j ( 0..$num_sections ) {
# TBODY tag
$html .= "<tbody";
# Set the section attributes (if any)
$html .= ' id="' . $self->{tbody}[0]->{id} . '"' if
defined $self->{tbody}[0]->{id};
===================================================
etc.
It needs to say
===================================================
my $num_sections = @{$self->{tbody}} - 1;
for my $j ( 0..$num_sections ) {
# TBODY tag
$html .= "<tbody";
# Set the section attributes (if any)
$html .= ' id="' . $self->{tbody}[$j]->{id} . '"' if
defined $self->{tbody}[$j]->{id};
==================================================
etc.
The part where it actually output the cells is right.
Colin