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,

  1. <com:TTable>
  2. <com:TTableRow>
  3. <com:TTableCell Text="content" />
  4. <com:TTableCell Text="content" />
  5. </com:TTableRow>
  6. <com:TTableRow>
  7. <com:TTableCell Text="content" />
  8. <com:TTableCell Text="content" />
  9. </com:TTableRow>
  10. </com:TTable>
The above can also be accomplished in code as follows,
  1. $table=new TTable;
  2. $row=new TTableRow;
  3. $cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
  4. $cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
  5. $table->Rows->add($row);
  6. $row=new TTableRow;
  7. $cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
  8. $cell=new TTableCell; $cell->Text="content"; $row->Cells->add($cell);
  9. $table->Rows->add($row);

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

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TWebControl
            |
            --TTable
Method Summary
void addParsedObject (mixed $object)
string getBackImageUrl ()
string getCaption ()
string getCaptionAlign ()
integer getCellPadding ()
integer getCellSpacing ()
string getGridLines ()
string getHorizontalAlign ()
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)

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.
createControlCollection (line 131)

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

TTableRowCollection createControlCollection ()

Redefinition of:
TControl::createControlCollection()
Creates a control collection object that is to be used to hold child controls
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 259)
  • return: the URL of the background image for the table
  • access: public
string getBackImageUrl ()
getCaption (line 147)
  • return: table caption
  • access: public
string getCaption ()
getCaptionAlign (line 163)
  • return: table caption alignment. Defaults to 'NotSet'.
  • access: public
string getCaptionAlign ()
getCellPadding (line 199)
  • return: the cellpadding for the table. Defaults to -1, meaning not set.
  • access: public
integer getCellPadding ()
getCellSpacing (line 180)
  • return: the cellspacing for the table. Defaults to -1, meaning not set.
  • access: public
integer getCellSpacing ()
getGridLines (line 238)
  • return: the grid line setting of the table. Defaults to 'None'.
  • access: public
string getGridLines ()
getHorizontalAlign (line 218)
  • return: the horizontal alignment of the table content. Defaults to 'NotSet'.
  • access: public
string getHorizontalAlign ()
getRows (line 139)
  • return: list of TTableCell controls
  • access: public
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 280)

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

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

Sets the URL of the background image for the table

  • access: public
void setBackImageUrl (string $value)
  • string $value: the URL
setCaption (line 155)
  • access: public
void setCaption (string $value)
  • string $value: table caption
setCaptionAlign (line 172)
  • access: public
void setCaptionAlign (string $value)
  • string $value: table caption alignment. Valid values include 'NotSet','Top','Bottom','Left','Right'.
setCellPadding (line 210)
  • access: public
void setCellPadding (integer $value)
  • integer $value: the cellpadding for the table. Defaults to -1, meaning not set.
setCellSpacing (line 191)
  • access: public
void setCellSpacing (integer $value)
  • integer $value: the cellspacing for the table. Defaults to -1, meaning not set.
setGridLines (line 251)

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 230)
  • 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::bubbleEvent()
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::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 Sun, 04 Jun 2006 19:00:22 -0400 by phpDocumentor 1.3.0RC4