在bootstrap中,当在引导程序中调整窗口大小时,两个div都相互重叠。我在表中使用angular作为数据点 查看预览:https://plnkr.co/edit/VKgh1su6HIueDhzWq497?p=preview
<div class="container">
<div class="row">
<div class="col-sm-3">
<!-- <h3></h3>-->
<!-- <table class="table" border ="1" cellpadding="0" cellspacing="0" style="height:100%;" -->
<table class="table" border ="1" >
<thead>
<tr>
<th colspan="2" >
Checker Statistics
</th>
</tr>
</thead>
<tbody>
<tr>
<th>
<br> Period
</td>
<th>
<ul>
<li>Yesterday</li>
<li>Today</li>
<li>This week</li>
<li>This month</li>
</ul>
</td>
</tr>
<tr>
<th>
From
</th>
<td>
<input type="text" name="">
</td>
</tr>
<tr>
<th>
To
</th>
<td>
<input type="text" name="">
</td>
</tr>
<tr>
<th colspan="2">
Filter Out Tests
<input type="checkbox" class="custom-control-input">
<span class="custom-control-indicator"></span>
<!-- <input type="checkbox" class="hidden" /> -->
</span>
</th>
</tr>
<tr>
<th colspan="2">
Compare Tests
<input type="checkbox" class="custom-control-input">
<span class="custom-control-indicator"></span>
</th>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</tbody>
</table>
<!-- <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>-->
</div>
<div class="col-sm-9">
<div class="table-responsive" >
<h4 align ="center">Site Data</h4>
<table class="table" border ="1">
<thead>
<tr>
<th>#</th>
<th>Site</th>
<th>Jobs</th>
<th>Success</th>
<th>Failed</th>
<!-- <th ng-bind="test"></th> -->
</tr>
</thead>
<tbody>
<tr ng-repeat="siteData in data">
<td>{{siteData.site}}</td>
<td>{{siteData.site}}</td>
<td>{{siteData.Jobs}}</td>
<td>{{siteData.Success}}</td>
<td>{{siteData.Failure}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
答案 0 :(得分:1)
您忘记将表格响应 div用于第一个表格。
<强> HTML:强>
<div class="container">
<div class="row">
<div class="col-sm-3">
<div class="table-responsive">
<table class="table" border="1">
<thead>
<tr>
<th colspan="2">
Checker Statistics
</th>
</tr>
</thead>
<tbody>
<tr>
<th>
<br> Period
</td>
<th>
<ul>
<li>Yesterday</li>
<li>Today</li>
<li>This week</li>
<li>This month</li>
</ul>
</td>
</tr>
<tr>
<th>
From
</th>
<td>
<input type="text" name="">
</td>
</tr>
<tr>
<th>
To
</th>
<td>
<input type="text" name="">
</td>
</tr>
<tr>
<th colspan="2">
Filter Out Tests
<input type="checkbox" class="custom-control-input">
<span class="custom-control-indicator"></span>
</span>
</th>
</tr>
<tr>
<th colspan="2">
Compare Tests
<input type="checkbox" class="custom-control-input">
<span class="custom-control-indicator"></span>
</th>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-sm-9">
<div class="table-responsive">
<h4 align="center">Site Data</h4>
<table class="table" border="1">
<thead>
<tr>
<th>#</th>
<th>Site</th>
<th>Jobs</th>
<th>Success</th>
<th>Failed</th>
<!-- <th ng-bind="test"></th> -->
</tr>
</thead>
<tbody>
<tr ng-repeat="siteData in data">
<td>{{siteData.site}}</td>
<td>{{siteData.site}}</td>
<td>{{siteData.Jobs}}</td>
<td>{{siteData.Success}}</td>
<td>{{siteData.Failure}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
答案 1 :(得分:0)
在<div class="table-responsive"></div>
中包含第一个表,就像您在第二个表中所做的那样
答案 2 :(得分:0)
在小型(sm
)屏幕中,第一个表格无法容纳四分之一的容器区域。
您可以分别将col-sm-3
和col-sm-9
更改为col-md-3
和col-md-9
,这样表格将仅以中等方式排列在彼此旁边({{1}屏幕和更宽。