Rectangle 27 1

There is no problem with the tablesorter, but your table html. You PHP code generates thead and several tbody tags. Normally there should be one tbody tag.

To fix that in your PHP before your while loop in put tbody opening and after your loop close the tag.

//open tbody tag
echo "<tbody>";

while($row = mysqli_fetch_array($result)){
    //print rows

//close tbody tag
echo "</tbody>";

There is also an unnecessary tbody closing in your "html code", it's better to remove it.

<div class="datagrid">
    <table id="myTable" class="tablesorter">  
        <?php displayHours();?>

Then your tablesorter would be working smoothly.

javascript - Tablesorter jQuery wont sort my table - Stack Overflow

javascript jquery html tablesorter
Rectangle 27 0

Don't know what pear is but: You can format columns like this in html:

  <col style="background: green;" />
  <col />
    <td>First TD of first TR</td>
    <td>Second TD of first TR</td>
    <td>First TD of second TR</td>
    <td>Second TD of second TR</td>

That makes the background of the first column green.

I understand how to do basic formatting, thanks. The problem is this is using a php framework (sort of) that queries a database and then spits it out into a table form that can be then displayed. Controlling the formatting of individual columns that are being auto-generated is the issue...

I understand that. But with the col tag it should be possible I think. Just add for loop which adds the col tags and you should be fine. Can you add the source code please, that I can understand whats the problem is?

k thanks for adding source. Should be possible with setColAttributes() (

html - Formatting tables generated with PHP/PEAR Structures_DataGrid &...

php html table datagrid pear
Rectangle 27 0

PHP DB Table to HTML Datagrid

This is a skeleton mock up for showing a database table in a basic datagrid with sorting and pagination.