| FormatNroff documentation | Contained in the FormatNroff distribution. |
HTML::FormatTableRowNroff - Format HTML Table row for nroff
require HTML::FormatTableRowNroff; $row = new HTML::FormatTableRowNroff(%attr);
The HTML::FormatTableRowNroff class is used to store information about a single row of a table. Once information about all the rows of the table has been recorded, an nroff tbl table may be created.
The following attributes are supported: align: 'left','center', or 'right' alignment of table row entries valign: vertical alignment, 'top' or 'middle'
Create a tbl format line for the row. $last_row is true if this is the last row in the table.
$formatter is the formatter being used (e.g.
HTML::FormatNroff).
@widths is an array of width information for each cell in the current row, specified in inches.
Add a new cell to the current row. %attr are the cell attributes,
as defined in HTML::FormatTableCellNroff.
Finish the current cell.
HTML::FormatTable, HTML::FormatTableNroff HTML::FormatTableRow HTML::FormatTableCell HTML::FormatTableCellNroff
Copyright (c) 1997 Frederick Hirsch. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Frederick Hirsch <f.hirsch@opengroup.org>
| FormatNroff documentation | Contained in the FormatNroff distribution. |
package HTML::FormatTableRowNroff;
require 5.004; require HTML::FormatTableRow; @ISA = qw(HTML::FormatTableRow); require HTML::FormatTableCellNroff; use strict; use Carp;
sub output_format { my($self, $final, $formatter, @widths) = @_; my $cell; my $index = 0; foreach $cell ( @ { $self->{'cells'} }) { my $str = $cell->format_str($widths[$index]); $formatter->out("$str "); $index++; } $cell = $self->{'current_cell'}; if(defined $cell && $cell ne "") { my $str = $cell->format_str($widths[$index]); $formatter->out("$str"); } if($final) { $formatter->out(".\n"); } else { $formatter->out("\n"); } }
sub add_element { my($self, %attr) = @_; if(defined($self->{'current_cell'})) { push(@ {$self->{'cells'}}, $self->{'current_cell'}); } $self->{'ended'} = 0; $self->{'current_cell'} = new HTML::FormatTableCellNroff(%attr); }
sub end_element { my($self) = @_; $self->{'ended'} = 1; }
1;