## Class TTable

Description

TTable class

TTable displays an HTML table on a Web page.

A table may have Caption, whose alignment is specified via CaptionAlign. The table cellpadding and cellspacing are specified via CellPadding and CellSpacing properties, respectively. The GridLines specifies how the table should display its borders. The horizontal alignment of the table content can be specified via HorizontalAlign, and BackImageUrl can assign a background image to the table.

A TTable maintains a list of TTableRow controls in its Rows property. Each TTableRow represents an HTML table row.

To populate the table Rows, 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);

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TTable.php (line 68)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TTable

Method Summary
void addAttributesToRender (THtmlWriter $writer)
void addParsedObject (mixed $object)
TTableStyle createStyle ()
string getBackImageUrl ()
string getCaption ()
string getCaptionAlign ()
integer getCellPadding ()
integer getCellSpacing ()
string getGridLines ()
string getHorizontalAlign ()
TTableRowCollection getRows ()
string getTagName ()
void renderBeginTag (THtmlWriter $writer)
void renderContents (THtmlWriter $writer)
void setBackImageUrl (string $value)
void setCaption (string $value)
void setCaptionAlign (string $value)
void setCellPadding (integer $value)
void setCellSpacing (integer $value)
void setGridLines (string $value)
void setHorizontalAlign (string $value)
Methods
addAttributesToRender (line 109)

Adds attributes to renderer.

- access: protected

void addAttributesToRender (THtmlWriter $writer)

- THtmlWriter $writer: the renderer

Redefinition of:

TWebControl::addAttributesToRender()
  Adds attribute name-value pairs to renderer.

addParsedObject (line 89)

Adds object parsed from template to the control.

This method adds only TTableRow objects into the Rows collection. All other objects are ignored.

- access: public

void addParsedObject (mixed $object)

- mixed $object: object parsed from template

Redefinition of:

TControl::addParsedObject()
  Processes an object that is created during parsing template.

createStyle (line 100)

Creates a style object for the control.

This method creates a TTableStyle to be used by the table.

- return: control style to be used
- access: protected

TTableStyle createStyle ()

Redefinition of:

TWebControl::createStyle()
  Creates a style object to be used by the control.

getBackImageUrl (line 251)

- return: the URL of the background image for the table
- access: public

string getBackImageUrl ()
getCaption (line 139)

- return: table caption
- access: public

string getCaption ()
getCaptionAlign (line 155)

- return: table caption alignment. Defaults to 'NotSet'.
- access: public

string getCaptionAlign ()
getCellPadding (line 191)

- return: the cellpadding for the table. Defaults to -1, meaning not set.
- access: public

integer getCellPadding ()
getCellSpacing (line 172)

- return: the cellspacing for the table. Defaults to -1, meaning not set.
- access: public

integer getCellSpacing ()
getGridLines (line 230)

- return: the grid line setting of the table. Defaults to 'None'.
- access: public

string getGridLines ()
getHorizontalAlign (line 210)

- return: the horizontal alignment of the table content. Defaults to 'NotSet'.
- access: public

string getHorizontalAlign ()
getRows (line 129)

- return: list of TTableRow controls
- access: public

TTableRowCollection getRows ()
getTagName (line 78)

- return: tag name for the table
- access: protected

string getTagName ()

Redefinition of:

TWebControl::getTagName()
  Returns the tag name used for this control.

renderBeginTag (line 272)

Renders the openning tag for the table control which will render table caption if present.

- access: public

void renderBeginTag (THtmlWriter $writer)

- THtmlWriter $writer: the writer used for the rendering purpose

Redefinition of:

TWebControl::renderBeginTag()
  Renders the openning tag for the control (including attributes)

renderContents (line 289)

Renders body contents of the table.

- access: public

void renderContents (THtmlWriter $writer)

- THtmlWriter $writer: the writer used for the rendering purpose.

Redefinition of:

TWebControl::renderContents()
  Renders the body content enclosed between the control tag.

setBackImageUrl (line 263)

Sets the URL of the background image for the table

- access: public

void setBackImageUrl (string $value)

- string $value: the URL

setCaption (line 147)

- access: public

void setCaption (string $value)

- string $value: table caption

setCaptionAlign (line 164)

- access: public

void setCaptionAlign (string $value)

- string $value: table caption alignment. Valid values include 'NotSet','Top','Bottom','Left','Right'.

setCellPadding (line 202)

- access: public

void setCellPadding (integer $value)

- integer $value: the cellpadding for the table. Defaults to -1, meaning not set.

setCellSpacing (line 183)

- access: public

void setCellSpacing (integer $value)

- integer $value: the cellspacing for the table. Defaults to -1, meaning not set.

setGridLines (line 243)

Sets the grid line style of the table.

Valid values include 'None', 'Horizontal', 'Vertical', 'Both'.

- access: public

void setGridLines (string $value)

- string $value: the grid line setting of the table

setHorizontalAlign (line 222)

- access: public

void setHorizontalAlign (string $value)

- string $value: the horizontal alignment of the table content. Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center'.

#### Inherited Methods

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> TWebControl::getFont()
> TWebControl::getForeColor()
> TWebControl::getHasStyle()
> TWebControl::getHeight()
> TWebControl::getStyle()
> TWebControl::getTabIndex()
> TWebControl::getTagName()
> TWebControl::getToolTip()
> TWebControl::getWidth()
> TWebControl::render()
> TWebControl::renderBeginTag()
> TWebControl::renderContents()
> TWebControl::renderEndTag()
> TWebControl::setAccessKey()
> TWebControl::setBackColor()
> TWebControl::setBorderColor()
> TWebControl::setBorderStyle()
> TWebControl::setBorderWidth()
> TWebControl::setCssClass()
> TWebControl::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::broadcastEventInternal()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::createdOnTemplate()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasControls()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onBubbleEvent()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants

#### Inherited Constants

Inherited from TControl

Documentation generated on Mon, 01 May 2006 23:04:45 -0400 by phpDocumentor 1.3.0RC4