Welcome Guest, Not a member yet? Register   Sign In
Table Class is missing <thead> and <tbody> options

[eluser]Dave Stewart[/eluser]
Hi All,

The table class is not quite fulfilling my expectations, as it's missing <thead> and <tbody> tags. This means I can't do cool stuff like sortable tables with jQuery, like this:


What would be the best way for me to fix this?

- Extend the table class?
- Copy the class, re-write it and place in the application/library folder?
- Something else?

I'm new to CI, so your help with best-practices is appreciated.

[eluser]Dave Stewart[/eluser]
OK, I've copied the class and made the edits successfully, and it works just fine as a replacement class, and also as an extended MY_Table class.

If anyone wants the class, I'll upload it to my server.


[eluser]Référencement Google[/eluser]
You can put it on the [url="http://codeigniter.com/wiki]Wiki[/url], or post it here on the forums if it's not too long, it will sure be useful for some people.

There is no need to do this, simply modify the table template.
$tmpl = array (
    'table_open'          => '<table class="tablesorter">',
    'heading_row_start'   => '<thead><tr>',
    'heading_row_end'     => '</tr></thead><tbody>',
    'table_close'         => '&lt;/body&gt;&lt;/table>'


[eluser]Colin Williams[/eluser]
Good call, blasto333. I didn't remember having a problem with this either.

Theme © iAndrew 2016 - Forum software by © MyBB