TTable displays an HTML table on a Web page.
A table may have {@link setCaption Caption}, whose alignment is specified
via {@link setCaptionAlign CaptionAlign}. The table cellpadding and cellspacing
are specified via {@link setCellPadding CellPadding} and {@link setCellSpacing CellSpacing}
properties, respectively. The {@link setGridLines GridLines} specifies how
the table should display its borders. The horizontal alignment of the table
content can be specified via {@link setHorizontalAlign HorizontalAlign},
and {@link setBackImageUrl BackImageUrl} can assign a background image to the table.
A TTable maintains a list of {@link TTableRow} controls in its
{@link getRows Rows} property. Each {@link TTableRow} represents
an HTML table row.
To populate the table {@link getRows Rows}, you may either use control template
or dynamically create {@link TTableRow} in code.
In template, do as follows to create the table rows and cells,
The above can also be accomplished in code as follows,
$table=new TTable;
$row=new TTableRow;
$cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
$cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
$table->Rows->add($row);
$row=new TTableRow;
$cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
$cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
$table->Rows->add($row);