【发布时间】:2016-02-01 19:25:00
【问题描述】:
我想要做的是并排对齐 2 个 div,第一个 div 包含一些文本,另一个包含一个 html 表格。
我的问题是有没有办法将 2 个 div 并排放置而不超过容器宽度?
这是我的 html 和 css 代码:
HTML:
<table class="table table-curved">
<thead>
<tr>
<th>Mail</th>
<th>Queued</th>
<th>Delivered</th>
<th>Bounced</th>
<th>Complaints</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="title">alfa beta</span>
</td>
<td>295,063</td>
<td>201,896</td>
<td>94,023</td>
<td>201,896</td>
</tr>
<tr>
<td><span class="title">gama phy</span>
</td>
<td>634,235</td>
<td>500,321</td>
<td>94,023</td>
<td>135,456</td>
</tr>
<tr>
<td colspan="15">
<div style="margin-top:15px">
<div>|__</div>
<table class="table table-curved">
<thead>
<tr>
<th>ISP</th>
<th>Queued</th>
<th>Delivered</th>
<th>Bounced</th>
<th>Complaints</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="title">lookup</span>
</td>
<td>295,063</td>
<td>201,896</td>
<td>94,023</td>
<td>135,456</td>
</tr>
<tr>
<td><span class="title">deny</span>
</td>
<td>295,063</td>
<td>201,896</td>
<td>94,023</td>
<td>201,896</td>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
CSS:
<style>
.table-curved {
border-collapse: separate;
font-size: 11px;
}
.table-curved button{
font-size: 9px;
}
.table-curved {
border: solid #ccc 1px;
border-radius: 6px;
border-left:0px;
}
.table-curved>thead>tr>th{
border-bottom: 0!important;
background-color: #E7F7FF;
}
.table-curved td, .table-curved th {
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
padding: 5px!important;
}
.table-curved th {
border-top: none;
}
.table-curved th:first-child {
border-radius: 6px 0 0 0;
}
.table-curved th:last-child {
border-radius: 0 6px 0 0;
}
.table-curved th:only-child{
border-radius: 6px 6px 0 0;
}
.table-curved tr:last-child td:first-child {
border-radius: 0 0 0 6px;
}
.table-curved tr:last-child td:last-child {
border-radius: 0 0 6px 0;
}
.tree{
display: inline-block; vertical-align: top;
}
.nested-table{
position: relative;
top: -15px;
right: 20px;
}
</style>
这是一个显示问题的图像:
【问题讨论】:
标签: html twitter-bootstrap css twitter-bootstrap-3