显示Php阵列:Line&柱

时间:2014-02-28 19:38:43

标签: php arrays

我在显示php数组时遇到问题。

我希望以水平和水平显示结果垂直线&柱

SQL:

       $bdd->query("SELECT DISTINCT sk.keyword AS keyword, sk.id_keyword, sk.search, su.url, suc.id_concurrent, suc.url_concurrent, skr.position, skr.date

        FROM seo_keywords_user AS sku           
        LEFT JOIN seo_keywords AS sk ON sku.id_keyword=sk.id_keyword            
        LEFT JOIN seo_users AS su ON su.id=sku.id_user          
        LEFT JOIN seo_users_concurrent AS suc ON suc.id_user = sku.id_user          
        LEFT JOIN seo_keywords_rank AS skr ON skr.id_concurrent = suc.id_concurrent AND skr.id_keyword =sk.id_keyword 

        WHERE sku.id_user='".$_SESSION['id']."'         
        AND skr.id_concurrent = suc.id_concurrent

        ");
        $ranking = $bdd->fetchAllObject();
<table id="demo-dtable-03" class="table table-striped" style="text-align:center">
                                          <thead>
                                              <tr>
                                                  <th style="text-align: center">Keyword</th>
                                                  <th style="border-right: 1px solid black; text-align: center"># search</th>

                                                  <th style="text-align: center">Website 1</th>
                                                  <th style="text-align: center">Website x</th>
                                                  <th style="text-align: center">Website x</th>
                                                  <th style="text-align: center">Website x</th>

                                              </tr>
                                          </thead>
                                          <tbody>
                                      <?php foreach($ranking as $rank): ?>
                                              <tr>                                            
                                                  <td style="background-color: white;border-bottom: none;  text-align: center"><?php echo $rank->keyword; ?></td>
                                                  <td style="text-align: center; background-color: white; border-right: 1px solid black;"><?php echo $rank->search; ?></td>
                                                  <td><?php echo $rank->url_concurrent; ?></td>
                                                  <td><?php echo $rank->position; ?></td>
                                                  <td></td>
                                                  <td></td>
                                              </tr> 
                                      <?php endforeach; ?>            
                                          </tbody>
                                      </table>

结果: http://www.lotoresultats.fr/img/table-no.jpg

我想: http://www.lotoresultats.fr/img/table-ok.jpg

提前感谢您的帮助。

0 个答案:

没有答案