Welcome Guest, Not a member yet? Register   Sign In
Updated Table Class
#1

[eluser]Media Gearhead[/eluser]
I took some time to edit the table class for a project I have now. I figured it would be best to pass this along to the community.

Simply change out your table library file to get support for the following.

Additional Tags:
Code:
<thead></thead>
<tbody></tbody>
<tfoot></tfoot>

Additional Method:
$this->table->set_footer();
This works exactly the same as $this->table->set_heading();
Permits you to set the table heading. You can submit an array or discrete params:
Code:
$this->table->set_footer('Name', 'Color', 'Size');
$this->table->set_footer(array('Name', 'Color', 'Size'));

Extended Template:
Code:
'table_open'             => '<table border="0" cellpadding="4" cellspacing="0">',

'thead_open'            => '<thead>',
'thead_close'            => '</thead>',
                        
'heading_row_start'     => '<tr>',
'heading_row_end'         => '</tr>',
'heading_cell_start'    => '<th>',
'heading_cell_end'        => '</th>',

'tfoot_open'            => '<tfoot>',
'tfoot_close'            => '</tfoot>',
                        
'footer_row_start'     => '<tr>',
'footer_row_end'         => '</tr>',
'footer_cell_start'    => '<th>',
'footer_cell_end'        => '</th>',

'tbody_open'            => '<tbody>',
'tbody_close'            => '</tbody>',
                        
'row_start'             => '<tr>',
'row_end'                 => '</tr>',
'cell_start'            => '<td>',
'cell_end'                => '</td>',

'row_alt_start'         => '<tr>',
'row_alt_end'             => '</tr>',
'cell_alt_start'        => '<td>',
'cell_alt_end'            => '</td>',

'table_close'             => '</table>'

Any questions please let me know but I think that it should be straight forward enough to work with.

File is attached.
#2

[eluser]InsiteFX[/eluser]
Most of these have already been fixed in CI 2.0

Also you should extend the library not make changes to it!

InsiteFX
#3

[eluser]Media Gearhead[/eluser]
I had a feeling that these would be setup in 2.0 I just needed it now. Also yes I know that extending the function is better than replacing it I just wanted to go quick and dirty.




Theme © iAndrew 2016 - Forum software by © MyBB