shaddf Posted June 16, 2017 Share Posted June 16, 2017 (edited) i have this table +------+---------------------------------------------------------+---------------------+-------------------+--------+-------+ | P_id |shortname | group_concat(Apps1) | group_concat(Gls) | t_Apps | t_Gls | +------+---------------------------------------------------------+---------------------+-------------------+--------+-------+ | 1 | Friendly,NDIV V | 1,1 | 3,0 | 2 | 3 | | 2 | Friendly,NDIV V | 1,1 | 1,0 | 2 | 1 | | 3 | Friendly,NDIV V | 1,1 | 0,1 | 2 | 1 | | 4 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 10 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 11 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 12 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 13 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | +------+---------------------------------------------------------+---------------------+-------------------+--------+-------+ 8 rows in set, 1 warning (0.29 sec) how can i populate its data into an html table with this structure using php <table> <thead> <tr> <th class=" header" colspan="1">2015/2016</th> <th class=" header" colspan="2">NDIV V Lge</th> <th class=" header" colspan="2">Friendlies</th> <th class=" header" colspan="2">Total</th> </tr> <tr> <th class="header">P_id.</th> <th class=" header">Ap</th> <th class=" header">Gl</th> <th class=" header">Ap</th> <th class=" header">Gl</th> <th class="header">Ap</th> <th class="header">Gl</th> </tr> </thead> <tbody> <tr> <td>43</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td>0 + 1</td> <td>0</td> </tr><tr> <td>42</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td>0 + 2</td> <td>0</td> </tr><tr> <td>36</td> <td class=" ">1 + 0</td> <td class=" ">0</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td>7 + 10</td> <td>2</td> </tr></tbody> </table> Edited June 16, 2017 by shaddf Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 16, 2017 Share Posted June 16, 2017 Sorry but what is "this structure"? Your headings are vague and the sample td elements have data that we don't see in your sample of data so we can't make sense of it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.