예제 #1
0
 /**
  * @param Axis $columns
  *   Either 'thead' or 'tbody' or 'tfoot'.
  * @param StaticAttributesMap $tableColAttributes
  *
  * @return string
  *   Rendered table section html.
  */
 function render(Axis $columns, StaticAttributesMap $tableColAttributes)
 {
     if ($this->rows->isEmpty() || !$columns->getCount()) {
         return '';
     }
     $container = new BuildContainer($this->rows->takeSnapshot(), $columns, $this->cellMap->getCells());
     /** @var BuildContainerBase $container */
     $container->OpenEndCells = $this->openEndMap->getNames();
     $container->RowAttributes = clone $this->rowAttributes->staticCopy();
     $container->RowStripings = $this->rowStripings;
     $container->TableColAttributes = $tableColAttributes;
     $container->SectionColAttributes = $this->colAttributes->staticCopy();
     /** @var BuildContainer $container */
     $innerHtml = $container->InnerHtml;
     return '  ' . $this->renderTag($this->tagName, "\n" . $innerHtml . '  ') . "\n";
 }
예제 #2
0
 /**
  * @param string[] $colClasses
  *   Format: $[$colName] = $class
  *
  * @return $this
  */
 function addColClasses(array $colClasses)
 {
     $this->colAttributes->namesAddClasses($colClasses);
     return $this;
 }