Populate HTML table with SQL data and PHP -
i trying populate table using a few loops.
first loop fills table headers users in row, no problem that.
the problem populating tds rows right ticket number.
i can numbers in order column in single td, not how should work
something this,
--------------------- user1 | user2 | user3 --------------------- 00001 | 00004 | 00007 00002 | 00005 | 00008 00003 | 00006 | 00009 ---------------------
and should be,
--------------------- user1 | user2 | user3 --------------------- 00001 | 00004 | 00007 --------------------- 00002 | 00005 | 00008 --------------------- 00003 | 00006 | 00009 ---------------------
you idea.
the code using that,
<table class="table table-hover"> <thead> <tr> <th scope="row"> <?php $username = functionname(); ($username->rewind(); $username->pointer < $username->size; $username->next()) { $record = $username->current(); $firstname = $record->fields->firstname; ?> <th><?php echo $firstname; ?></th> <?php } ?> </th> </tr> </thead> <tbody> <tr> <th scope="row"> <?php ($username->rewind(); $username->pointer < $username->size; $username->next()) { $record = $username->current(); $firstname = $record->fields->firstname; ?> <td> <?php $usercase = functioncase($firstname); ($usercase->rewind(); $usercase->pointer < $usercase->size; $usercase->next()) { $record = $usercase->current(); $casenumber = $record->fields->casenumber; $status = $record->fields->status; echo $casenumber; ?> <?php } ?> </td> <?php } ?> </th> </tr> </tbody> </table>
i think might using wrong logic , loops part.
any ideas how achieve proper table result?
i think using incorrect html table layout.
you have td inside th, not allowed far know. if want display data in several rows, have create tr every row. trs can contain th , td items. valid table layout, please refer http://www.w3schools.com/tags/att_th_scope.asp
Comments
Post a Comment