Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何使用bootstrap3在表旁边放置按钮_Html_Css_Twitter Bootstrap 3 - Fatal编程技术网

Html 如何使用bootstrap3在表旁边放置按钮

Html 如何使用bootstrap3在表旁边放置按钮,html,css,twitter-bootstrap-3,Html,Css,Twitter Bootstrap 3,如何设置一个按钮坐在一个div内的一张桌子旁边 我的代码是: <div class="col-xs-6"> <!-- main div --> <div> <!-- table div --> <table class="table table-bordered table-striped text-center"> <thead><tr> <!-- 4 H

如何设置一个按钮坐在一个div内的一张桌子旁边

我的代码是:

 <div class="col-xs-6">  <!-- main div -->
  <div> <!-- table div -->
    <table class="table table-bordered table-striped text-center">
      <thead><tr>
           <!-- 4 Header -->
      </tr></thead>
      <tbody> <tr><td>
            <!-- first row -->
      </td></tr></tbody>
     </table>
    </div> 
  <div class="col-xs-4">
  <div class="col-xs-2" >
    <button type="button" class="btn btn-primary"  name="search" id="search">Search</button>   
  </div>
  <div class="col-xs-2" >
    <button type="button" class="btn btn-primary"  name="add" id="add">Add</button> 
  </div>   
</div>

搜寻
添加
--主分区关闭

我得到的是:


将主div放入类:
col-xs-12

和按钮
div
col-xs-8
col-xs-10

因此,main是总共12个,在其中您放置带有
*-xs-2
的表和带有
*-xs-8
的按钮

试试这个

     <!-- 
  Bootstrap docs: https://getbootstrap.com/docs
-->
<div class="container">
<div class="row"> 
  <div class="col-xs-4"> 
    <table class="table">
    <thead>
      <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Email</th>
        <th></th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>John</td>
        <td>Doe</td>
        <td>john@example.com</td>
      </tr>
    </tbody>
  </table>
  </div> 
  <div class="col-xs-8">
  <div class="row">

    <div class="col-xs-3" >
        <button type="button" class="btn btn-primary"  name="search" id="search">Search</button>   
    </div>
    <div class="col-xs-3" >
        <button type="button" class="btn btn-primary"  name="add" id="add">Add</button>  
    </div>

  </div>
   </div>
  </div>
  </div>

名字
姓氏
电子邮件
约翰
雌鹿
john@example.com
搜寻
添加

检查此项:

已尝试。但它显示了答案中添加的表格和按钮之间的巨大差距。请参考解决方案,明白吗@anupriyastill same.或者我可以用它来代替它?添加屏幕截图。你的期望是什么?在油漆上画画并在这里分享照片,这样我们就可以解决你的问题了