/**
  * Parse an array of headers and an array of visible header names into multiple
  * TableHeaderCellModels, stored in the tableHeaders property of this object.
  *
  * @param array $headerData
  * @param array $visibleHeaders
  * @param array $columnWidths
  */
 public function addHeaders(array $headerData, array $visibleHeaders = array(), $columnWidths = array())
 {
     if (!empty($visibleHeaders)) {
         $visibleHeaders = $this->flattenHeadersArray($visibleHeaders);
     }
     foreach ($headerData as $header) {
         $newHeader = new TableHeaderCellModel($header, '');
         if (!empty($visibleHeaders)) {
             $newHeader->setVisible(in_array($header, $visibleHeaders));
         }
         if (!empty($columnWidths) && array_key_exists($header, $columnWidths)) {
             $newHeader->setWidth($columnWidths[$header]);
         }
         if (!empty($this->dataTypes) && isset($this->dataTypes[$header])) {
             $newHeader->setDataType($this->dataTypes[$header]);
         }
         $this->tableHeaders[$newHeader->getSafeName()] = $newHeader;
     }
 }
 /**
  * Wraps the content cell in a <td> element
  *
  * @param TableHeaderCellModel $tableHeader
  * @param TableRowModel $tableRow
  * @param string $tdClass
  * @return string
  */
 public static function printCustomTableCell(TableHeaderCellModel $tableHeader, TableRowModel $tableRow, $tdClass = "kolom")
 {
     $tdClass = empty($tableHeader->getHtmlClass()) ? $tdClass : $tableHeader->getHtmlClass();
     $string = "<td class=\"%1\$s\">" . $tableHeader->getHtmlContent() . "</td>";
     return sprintf($string, $tdClass . ' ' . $tableHeader->getSafeName(), $tableRow->getCellValue('id'));
 }