public function __construct($width)
 {
     $styleColumn = new odsStyleTableColumn();
     $styleColumn->setColumnWidth($width);
     parent::__construct($styleColumn);
 }
Exemplo n.º 2
0
 public function getContent(ods $ods, DOMDocument $dom)
 {
     $table_table = $dom->createElement('table:table');
     $table_table->setAttribute("table:name", $this->name);
     $table_table->setAttribute("table:style-name", $this->styleName);
     $table_table->setAttribute("table:print", $this->print);
     if (count($this->tableColumns)) {
         foreach ($this->tableColumns as $tableColumn) {
             $table_table->appendChild($tableColumn->getContent($ods, $dom));
         }
     } else {
         $column = new odsTableColumn($ods->getStyleByName('co1'));
         $table_table->appendChild($column->getContent($ods, $dom));
     }
     if (count($this->rows)) {
         foreach ($this->rows as $row) {
             $table_table->appendChild($row->getContent($ods, $dom));
         }
     } else {
         $row = new odsTableRow();
         $table_table->appendChild($row->getContent($ods, $dom));
     }
     return $table_table;
 }