2016-09-22 56 views
0

我不知道哪个是处理引导3中的静态表头并保持引导表css类的响应式设计的最佳方式。引导3 - 静态表头实现

所以<滚动表格行时,>标签应该是静态的。

<table class="table table-striped"> 
    <thead> 
    <tr> 
    <th>Col1</th> 
    <th>Col2</th> 
    <th>Col3</th> 
    <th>Col4</th> 
    </tr> 
</thead> 
<tbody> 
<tr> 
    <td>Some data..</td> 
    <td>Some data..</td> 
</tr> 
.... 
+0

必须使用DIV CLASS = “表响应” 得到它完全负责,你可以使用table class =“table”里面,查de文档: http://www.w3schools.com/boots陷阱/ bootstrap_ref_css_tables.asp – JoelBonetR

回答

0

我不能评论,因为我没有足够的代表。

因此,基本上你想关闭bootstrap中thead元素的响应部分?只是正常?

0

CSS

tr { 
width: 100%; 
display: inline-table; 
height:60px; 
table-layout: fixed; 

} 

table{ 
height:300px; 
display: -moz-groupbox; 
} 
tbody{ 
    overflow-y: scroll; 
    height: 200px; 
    width: 100%; 
    position: absolute; 
} 

HTML

<table class="table table-striped"> 
    <thead> 
    <tr> 
    <th>Col1</th> 
    <th>Col2</th> 
    <th>Col3</th> 
    <th>Col4</th> 
    </tr> 
</thead> 
<tbody> 
<tr> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
</tr> 
<tr> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
</tr> 
<tr> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
</tr> 
<tr> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
</tr> 
<tr> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
    <td>Some data..</td> 
</tr> 

试试这个..