Welcome to the Cookbook

loading...

7.4.1.15 tableHeaders

tableHeaders(array $names, array $trOptions = null, array $thOptions = null)

Creates a row of table header cells to be placed inside of <table> tags.

<?php echo $this->Html->tableHeaders(array('Date','Title','Active'));?>

//Output 
<tr>
    <th>Date</th>
    <th>Title</th>
    <th>Active</th>
</tr>
 
<?php echo $this->Html->tableHeaders(
    array('Date','Title','Active'),
    array('class' => 'status'),
    array('class' => 'product_table')
);?>
 
//Output
<tr class="status">
     <th class="product_table">Date</th>
     <th class="product_table">Title</th>
     <th class="product_table">Active</th>
</tr>
  1. <?php echo $this->Html->tableHeaders(array('Date','Title','Active'));?>
  2.  
  3. //Output
  4. <tr>
  5. <th>Date</th>
  6. <th>Title</th>
  7. <th>Active</th>
  8. </tr>
  9. <?php echo $this->Html->tableHeaders(
  10. array('Date','Title','Active'),
  11. array('class' => 'status'),
  12. array('class' => 'product_table')
  13. );?>
  14. //Output
  15. <tr class="status">
  16. <th class="product_table">Date</th>
  17. <th class="product_table">Title</th>
  18. <th class="product_table">Active</th>
  19. </tr>