doumiao0498 2018-05-31 18:46
浏览 56

表和按钮在html和php与bootstrap

In this code that have to print a table and 3 buttons, the 3 buttons appear above the table but i want them under the table. What can I fix? And how can i print them inline? I tried with a div with style display inline but doesn't work.

echo "<div class='container'>";
    echo "<br>";
    echo "<table class='table table-hover' style='border: 1px solid black; margin-left:auto; margin-right:auto;'><caption><h2>Esperienze di Lavoro</h2>
</caption> <thead> <tr>";
    echo "<th style='border: 1px solid black;'> Username </th><th style='border: 1px solid black;'> Password </th><th style='border: 1px solid black;'> Nome </th> <th style='border: 1px solid black;'> Cognome </th> <th style='border: 1px solid black;'> Data di Nascita </th> <th style='border: 1px solid black;'> Email </th> <th style='border: 1px solid black;'> Foto </th>";
    echo "</tr> </thead> <tbody> <tr>";
    echo "<td style='border: 1px solid black;'>".$_COOKIE["username"]."</td>";
    echo "<td style='border: 1px solid black;'>".$_COOKIE["password"]."</td>";
    echo "<td style='border: 1px solid black;'>".$_COOKIE["name"]."</td>";
    echo "<td style='border: 1px solid black;'>".$_COOKIE["surname"]."</td>";
    echo "<td style='border: 1px solid black;'>".$_COOKIE["birth"]."</td>";
    echo "<td style='border: 1px solid black;'>".$_COOKIE["mail"]."</td>";
    echo "<td style='border: 1px solid black;'><img src=".$_COOKIE["foto"]." style='width:128px;height:128px;'></td>";
    echo "</tr></tbody</table>";
    echo "
    <div class='form-group'>        
  <div class='col-sm-offset-2 col-sm-10'><button type='button' name='mod_nome' class='btn btn-primary' onclick='Funzione1()';>Modifica Informazioni</button></div>
</div>";
    echo "<div class='form-group'>        
  <div class='col-sm-offset-2 col-sm-10'><button type='button' name='studio' class='btn btn-primary' onclick='Funzione2()';>Aggiungi Esperienze </button></div>
</div>";
    echo "
<div class='form-group'>        
  <div class='col-sm-offset-2 col-sm-10'> <button type='button' name='comp' onclick='Funzione7()' class='btn btn-primary';>Compagnie in cui i nostri iscritti lavorano</button></div>
</div>";

I'm using bootstrap.

  • 写回答

1条回答 默认 最新

  • dqlk31541 2018-05-31 18:48
    关注

    Your button code is fine, you just need to close <tbody></tbody>

    echo "</tr></tbody></table>";
    

    To align the buttons,

    <style>
    #btnSearch,
    #btnClear{
        display: inline-block;
        vertical-align: top;
    }
    </style>       
    <div class="row">
        <div class="col-sm-12 text-center">
            <button id="btnSearch" class="btn btn-primary btn-md center-block" Style="width: 100px;">button-1</button>
             <button id="btnClear" class="btn btn-danger btn-md center-block" Style="width: 100px;">button-2</button>
             <button id="btnClear" class="btn btn-danger btn-md center-block" Style="width: 100px;">button-3</button>
         </div>
    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题