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

  • 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
Methods
addAttributesToRender (line 104)

Adds attributes to renderer.

  • access: protected
void addAttributesToRender (THtmlWriter $writer)

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

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)
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)
setHorizontalAlign (line 223)
  • access: public
void setHorizontalAlign (THorizontalAlign $value)

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

Documentation generated on Mon, 21 Apr 2008 11:36:23 -0400 by phpDocumentor 1.3.0RC4