## 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: $Id: TTable.php 1398 2006-09-08 19:31:03Z xue $
- 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)
TTableRowCollection createControlCollection ()
TTableStyle createStyle ()
string getBackImageUrl ()
string getCaption ()
TTableCaptionAlign getCaptionAlign ()
integer getCellPadding ()
integer getCellSpacing ()
TTableGridLines getGridLines ()
THorizontalAlign getHorizontalAlign ()
TTableRowCollection getRows ()
string getTagName ()
void renderBeginTag (THtmlWriter $writer)
void renderContents (THtmlWriter $writer)
void setBackImageUrl (string $value)
void setCaption (string $value)
void setCaptionAlign (TTableCaptionAlign $value)
void setCellPadding (integer $value)
void setCellSpacing (integer $value)
void setGridLines (TTableGridLines $value)
void setHorizontalAlign (THorizontalAlign $value)
Methods
addAttributesToRender (line 104)

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 84)

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()
  Adds the object instantiated on a template to the child control collection.

createControlCollection (line 126)

Creates a control collection object that is to be used to hold child controls

- return: control collection
- access: protected
- see: TControl::getControls()

TTableRowCollection createControlCollection ()

Redefinition of:

TControl::createControlCollection()
  Creates a control collection object that is to be used to hold child controls

createStyle (line 95)

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 250)

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

string getBackImageUrl ()
getCaption (line 142)

- return: table caption
- access: public

string getCaption ()
getCaptionAlign (line 158)

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

TTableCaptionAlign getCaptionAlign ()
getCellPadding (line 193)

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

integer getCellPadding ()
getCellSpacing (line 174)

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

integer getCellSpacing ()
getGridLines (line 231)

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

TTableGridLines getGridLines ()
getHorizontalAlign (line 212)

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

THorizontalAlign getHorizontalAlign ()
getRows (line 134)

- return: list of TTableRow controls
- access: public

TTableRowCollection getRows ()
getTagName (line 73)

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

string getTagName ()

Redefinition of:

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

renderBeginTag (line 271)

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 288)

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 262)

Sets the URL of the background image for the table

- access: public

void setBackImageUrl (string $value)

- string $value: the URL

setCaption (line 150)

- access: public

void setCaption (string $value)

- string $value: table caption

setCaptionAlign (line 166)

- access: public

void setCaptionAlign (TTableCaptionAlign $value)

- TTableCaptionAlign $value: table caption alignment.

setCellPadding (line 204)

- access: public

void setCellPadding (integer $value)

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

setCellSpacing (line 185)

- access: public

void setCellSpacing (integer $value)

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

setGridLines (line 242)

- access: public

void setGridLines (TTableGridLines $value)

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

setHorizontalAlign (line 223)

- access: public

void setHorizontalAlign (THorizontalAlign $value)

- THorizontalAlign $value: the horizontal alignment of the table content.

#### Inherited Methods

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::clearStyle()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> TWebControl::getDisplay()
> 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::setDisplay()
> TWebControl::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::addToPostDataLoader()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::convertUniqueIdToClientId()
> TControl::createChildControls()
> TControl::createControlCollection()
> 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::getCustomData()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasChildInitialized()
> TControl::getHasControls()
> TControl::getHasInitialized()
> TControl::getHasLoaded()
> TControl::getHasLoadedPostData()
> TControl::getHasPreRendered()
> 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::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::setCustomData()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::trackViewState()
> 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::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> 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

> TControl::AUTOMATIC_ID_PREFIX
> TControl::CLIENT_ID_SEPARATOR
> TControl::CS_CHILD_INITIALIZED
> TControl::CS_CONSTRUCTED
> TControl::CS_INITIALIZED
> TControl::CS_LOADED
> TControl::CS_PRERENDERED
> TControl::CS_STATE_LOADED
> TControl::ID_FORMAT
> TControl::ID_SEPARATOR
> TControl::IS_CHILD_CREATED
> TControl::IS_CREATING_CHILD
> TControl::IS_DISABLE_THEMING
> TControl::IS_DISABLE_VIEWSTATE
> TControl::IS_ID_SET
> TControl::IS_SKIN_APPLIED
> TControl::IS_STYLESHEET_APPLIED
> TControl::RF_ADAPTER
> TControl::RF_AUTO_BINDINGS
> TControl::RF_CHILD_STATE
> TControl::RF_CONTROLS
> TControl::RF_CONTROLSTATE
> TControl::RF_DATA_BINDINGS
> TControl::RF_EVENTS
> TControl::RF_NAMED_CONTROLS
> TControl::RF_NAMED_CONTROLS_ID
> TControl::RF_NAMED_OBJECTS
> TControl::RF_SKIN_ID

Documentation generated on Sun, 30 Sep 2007 19:17:33 -0400 by phpDocumentor 1.3.0RC4