2013-10-29 25 views
2

我在twitter引导中卡住表格。无论我尝试什么,我都无法在范围内获得我的表格,我认为它与引导程序CSS有关,我需要我的表格行在范围或英雄单位内是合理的。Twitter Bootstrap表格调整大小,行溢出

<div class="table-responsive"> 
    <table id="table" 
      class="table table-bordered table-condensed table-striped form-group"> 
    <tbody> 
     <tr> 
     <th>Sl. No.</th> 
     <th class="">Name</th> 
     <th>C/NC</th> 
     <th class="">Quantity</th> 
     <th>Price</th> 
     <th><input type="button" class="btn btn-success" id="addmorebutton" 
        value="Add" onclick="addRow();"/></th> 
     </tr> 
     <tr id="templateRow"> 
     <td><input type="text" placeholder="In Words"></td> 
     <td class=""><input type="text" placeholder="In Words"></td> 
     <td> 
      <select class="input-sm col-lg-2"> 
       <option>Consumable</option> 
       <option>Non Consumable</option> 
      </select> 
     </td> 
     <td class=""><input type="text" placeholder="In Numbers"></td> 
     <td><input type="text" placeholder="In Numbers"></td> 
     <td><input type="button" class="btn btn-danger" id="addmorebutton" 
        value="Delete" onclick="delRow(this);"/></td> 
    </tr> 
    </tbody> 
</table> 
</div> 
+2

您是否有链接到测试网站的链接?我不能告诉你所提供的代码 –

+0

你是否需要使用表格? Bootstrap带有一个网格系统http://getbootstrap.com/css/#grid-options – Scott

回答

1

如果您是通过造型父span元素试图位置table,你需要做的跨度为块级元素。跨度本质上不是块级元素;因此,它会崩溃并且不会包含页面流中的表格。使用blockinline-block是您可以将跨度更改为正确包含的方法之一。然而,为了使它更容易,你总是可以使用块级元素开始,如div或样式表本身。

尝试display:block;在您的<span> CSS上。这将迫使它包含其子元素。

没有更多的信息,很难理解你要完成什么。 有关块级元素的更多信息:https://developer.mozilla.org/en-US/docs/HTML/Block-level_elements