2017-05-23 83 views
0

Bootsrap响应表如下工作:Bootsrap响应表主表TD手机不能正常工作

<div class="table-responsive"> 
<table class="table"><tr><td>responsive working</td></tr></table> 
</div> 

但是,当我在主表格单元格(TD)内响应表中使用不工作。我们可以做些什么来解决它?

<table> 
<tr> 
<td> 

<div class="table-responsive"> 
<table class="table">now not responsive</table> 
</div> 

</td> 
</tr> 
</table> 
+0

何必把其它表的表里面? – Swellar

+0

@Swellar你是正确的divs有用,而不是前台的表格,但这是管理面板。表格老习惯,对我来说很简单,而不是div。我正在使用第一个表主模块(第一个tr模块标题和第二个tr模块内容等..) – webmaster

回答

1

你可以做这样的事情,但问题是,你有没有指定其自带的自举“table”你必须先提一下它的默认表类。不table-responsive,它必须是table table-responsive

<html> 
 
<head> 
 
<head> 
 
    <title>Bootstrap Example</title> 
 
    <meta charset="utf-8"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
 
</head> 
 
    <meta charset="utf-8"> 
 
</head> 
 
<body> 
 
<table class="table table-responsive"> 
 
    <th colspan="3">Outer Table</th> 
 
    <tr> 
 
    <td>This is row one, column 1</td> 
 
    <td>This is row one, column 2</td> 
 
    
 
    <td> 
 
     <table class="table table-responsive"> 
 
     <th colspan="3">Second Inner Table</th> 
 
     <tr> 
 
      <td>This is row one, column 1</td> 
 
      <td>This is row one, column 2</td> 
 
      <td>This is row one, column 3</td> 
 
     </tr> 
 
     </table> 
 
    </td> 
 
    </tr> 
 
</table> 
 
    
 

 
</body> 
 
</html>

+0

感谢您的答案,我确实尝试修复它在我的代码,但响应不工作(滚动条没有来)我将尝试在新页面中的所有代码。 – webmaster

+0

我确实尝试了很多组合,但没有工作,你能看看这个吗? https://codepen.io/anon/pen/zwyaJX – webmaster

+0

@webmaster现在检查了这一点https://codepen.io/anon/pen/pPqKmx你已经添加了非密码divs – AVI