CodeIgniter Forums
Table heading with multiple rows - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Table heading with multiple rows (/showthread.php?tid=68381)



Table heading with multiple rows - slipdiegoknot - 07-03-2017

I need to create this using table library. set_heading only adds one row heading I need two.

Code:
<thead>
<tr>
  <th>head1<th>
  <th>head2<th>
<tr>
<tr>
  <th>head1<th>
  <th>head2<th>
<tr>
</thead>



RE: Table heading with multiple rows - InsiteFX - 07-03-2017

This is a snippet that I found on the web.

PHP Code:
<table>
 
 <col>
 
 <colgroup span="2"></colgroup>
 
 <colgroup span="2"></colgroup>
 
 <tr>
 
   <td rowspan="2"></td>
 
   <th colspan="2" scope="colgroup">Mars</th>
 
   <th colspan="2" scope="colgroup">Venus</th>
 
 </tr>
 
 <tr>
 
   <th scope="col">Produced</th>
 
   <th scope="col">Sold</th>
 
   <th scope="col">Produced</th>
 
   <th scope="col">Sold</th>
 
 </tr>
 
 <tr>
 
   <th scope="row">Teddy Bears</th>
 
   <td>50,000</td>
 
   <td>30,000</td>
 
   <td>100,000</td>
 
   <td>80,000</td>
 
 </tr>
 
 <tr>
 
   <th scope="row">Board Games</th>
 
   <td>10,000</td>
 
   <td>5,000</td>
 
   <td>12,000</td>
 
   <td>9,000</td>
 
 </tr>
</
table

The CodeIgniter html table has a table template so you would need to create your own table.