3 * TTableHeaderCell class file
5 * @author Qiang Xue <qiang.xue@gmail.com>
6 * @link http://www.pradosoft.com/
7 * @copyright Copyright © 2005-2014 PradoSoft
8 * @license http://www.pradosoft.com/license/
9 * @package System.Web.UI.WebControls
13 * Includes TTableCell class
15 Prado::using('System.Web.UI.WebControls.TTableCell');
19 * TTableHeaderCell class.
21 * TTableHeaderCell displays a table header cell on a Web page.
23 * @author Qiang Xue <qiang.xue@gmail.com>
24 * @package System.Web.UI.WebControls
27 class TTableHeaderCell extends TTableCell
30 * @return string tag name for the table header cell
32 protected function getTagName()
38 * Adds attributes to renderer.
39 * @param THtmlWriter the renderer
41 protected function addAttributesToRender($writer)
43 parent::addAttributesToRender($writer);
44 if(($scope=$this->getScope())!==TTableHeaderScope::NotSet)
45 $writer->addAttribute('scope',$scope===TTableHeaderScope::Row?'row':'col');
46 if(($text=$this->getAbbreviatedText())!=='')
47 $writer->addAttribute('abbr',$text);
48 if(($text=$this->getCategoryText())!=='')
49 $writer->addAttribute('axis',$text);
53 * @return TTableHeaderScope the scope of the cells that the header cell applies to. Defaults to TTableHeaderScope::NotSet.
55 public function getScope()
57 return $this->getViewState('Scope',TTableHeaderScope::NotSet);
61 * @param TTableHeaderScope the scope of the cells that the header cell applies to.
63 public function setScope($value)
65 $this->setViewState('Scope',TPropertyValue::ensureEnum($value,'TTableHeaderScope'),TTableHeaderScope::NotSet);
69 * @return string the abbr attribute of the HTML th element
71 public function getAbbreviatedText()
73 return $this->getViewState('AbbreviatedText','');
77 * @param string the abbr attribute of the HTML th element
79 public function setAbbreviatedText($value)
81 $this->setViewState('AbbreviatedText',$value,'');
85 * @return string the axis attribute of the HTML th element
87 public function getCategoryText()
89 return $this->getViewState('CategoryText','');
93 * @param string the axis attribute of the HTML th element
95 public function setCategoryText($value)
97 $this->setViewState('CategoryText',$value,'');
103 * TTableHeaderScope class.
104 * TTableHeaderScope defines the enumerable type for the possible table scopes that a table header is associated with.
106 * The following enumerable values are defined:
107 * - NotSet: the scope is not specified
108 * - Row: the scope is row-wise
109 * - Column: the scope is column-wise
111 * @author Qiang Xue <qiang.xue@gmail.com>
112 * @package System.Web.UI.WebControls
115 class TTableHeaderScope extends TEnumerable
117 const NotSet='NotSet';
119 const Column='Column';