Class \Prado\Web\UI\WebControls\TTable
TTable displays an HTML table on a Web page.
A table may have \Prado\Web\UI\WebControls\setCaption, whose alignment is specified via \Prado\Web\UI\WebControls\setCaptionAlign. The table cellpadding and cellspacing are specified via \Prado\Web\UI\WebControls\setCellPadding and \Prado\Web\UI\WebControls\setCellSpacing properties, respectively. The \Prado\Web\UI\WebControls\setGridLines specifies how the table should display its borders. The horizontal alignment of the table content can be specified via \Prado\Web\UI\WebControls\setHorizontalAlign, and \Prado\Web\UI\WebControls\setBackImageUrl can assign a background image to the table.
A TTable maintains a list of TTableRow controls in its \Prado\Web\UI\WebControls\getRows property. Each TTableRow represents an HTML table row.
To populate the table \Prado\Web\UI\WebControls\getRows, you may either use control template or dynamically create TTableRow in code. In template, do as follows to create the table rows and cells,
<com:TTable>
<com:TTableRow>
<com:TTableCell Text="content" />
<com:TTableCell Text="content" />
</com:TTableRow>
<com:TTableRow>
<com:TTableCell Text="content" />
<com:TTableCell Text="content" />
</com:TTableRow>
</com:TTable>
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);
Class hierarchy
- \Prado\Web\UI\WebControls\TTable
- \Prado\Web\UI\WebControls\TWebControl implements IStyleable
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
addParsedObject(mixed $object) : mixed
Adds object parsed from template to the control.
This method adds only TTableRow objects into the \Prado\Web\UI\WebControls\getRows collection. All other objects are ignored. |
public
|
|
public
|
|
public
|
|
public
deprecated
|
|
public
deprecated
|
|
public
deprecated
|
|
public
|
|
public
|
|
public
|
renderBeginTag(THtmlWriter $writer) : mixed
Renders the openning tag for the table control which will render table caption if present.
|
public
|
|
public
|
|
public
|
|
public
|
|
public
deprecated
|
|
public
deprecated
|
|
public
deprecated
|
|
public
|
|
protected
deprecated
|
|
protected
|
createControlCollection() : TTableRowCollection
Creates a control collection object that is to be used to hold child controls
|
protected
|
createStyle() : TTableStyle
Creates a style object for the control.
This method creates a TTableStyle to be used by the table. |
protected
|