Jump to content
shaddf

displaying data in html table

Recommended Posts

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 by shaddf

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.