douliang7068 2015-05-26 19:16
浏览 14
已采纳

使用bootstrap与PHP

I use bootstrap to make my site resopnsive and i have this table i fill with data from a webservice but my class container dont work now and i dont kow why.. Is it the php code that messup the boostrap or is it something i have done wrong?

<!--Tabell visa personal-->
    <div class="container">
    <div class="pull-left">
            <h1 class="regHead">Tabell för all personal</h1>
            <table class="table" id="speltabell">
                <thead>
                    <tr>
                        <th>Personnummer</th>
                        <th>Förnamn</th>
                        <th>Efternamn</th>
                        <th>Adress</th>
                        <th>Postnr</th>
                        <th>Ort</th>
                        <th>Hemtelefon</th>
                        <th>Mobil</th>
                        <th>Mail</th>
                    </tr>
                </thead>
            <tbody>       
    <?php 
    try
    {
        $soap_client = new
        soapclient("http://tsb01.cnap.hv.se/PersonalService/ServicePersonal.svc?wsdl");      
        $result = $soap_client->HamtaAllPersonal();
        var_dump($result);
        foreach ($result->HamtaAllPersonalResult->AllPersonal as $person) 
        {
        echo "<tr />";
        echo "<td>$person->PnrPersonal</td>";
        echo "<td>$person->FornamnPersonal</td>";
        echo "<td>$person->EfternamnPersonal</td>";
        echo "<td>$person->AdressPersonal</td>";
        echo "<td>$person->PostnrPersonal</td>";
        echo "<td>Bjas</td>";
        echo "<td>$person->HemtelefonPersonal</td>";
        echo "<td>$person->MobiltelefonPersonal</td>";
        echo "<td>$person->MailPersonal</td>";

        }    

    }
    catch(SoapFault $exception)
    {
        echo $exception->getMessage();
    }
    ?>
                    </tbody>
                </table>
        </div> <!--Slut tabell-->
        </div>
  • 写回答

1条回答 默认 最新

  • dongyouji7022 2015-05-26 19:50
    关注

    Replace the content in you foreach loop with this and learn HTML better:

    foreach ($result->HamtaAllPersonalResult->AllPersonal as $person) 
        {
        echo "<tr>";
        echo "<td>$person->PnrPersonal</td>";
        echo "<td>$person->FornamnPersonal</td>";
        echo "<td>$person->EfternamnPersonal</td>";
        echo "<td>$person->AdressPersonal</td>";
        echo "<td>$person->PostnrPersonal</td>";
        echo "<td>Bjas</td>";
        echo "<td>$person->HemtelefonPersonal</td>";
        echo "<td>$person->MobiltelefonPersonal</td>";
        echo "<td>$person->MailPersonal</td>";
        echo "</tr>";
        }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作