尝试拥有一排3个面板,其中高度根据内容扩展,并且它们都正确对齐。左侧面板中会有一个图形,右侧的两个图形将具有与左侧图形一起使用的表格。
这个工作的例子是这个模板:Click Here For Example
<div class="row">
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">Panel content
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">Panel content
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">Panel content
</div>
</div>
</div>
</div>
答案 0 :(得分:14)
嵌套网格列,请参阅:http://getbootstrap.com/css/#grid-nesting
<强> HTML 强>
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Graph</h3>
</div>
<div class="panel-body">
<img src="http://dummyimage.com/600x500/000/fff&text=Graph" class="img-responsive">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div>
</div>
</div>
</div>
</div>
更新我忘记了您可以在https://stackoverflow.com/a/12330800/1596547使用的上述示例的自动高度部分:
$( window ).load(function() {
boxes = $('.col-sm-6');
maxHeight = Math.max.apply(
Math, boxes.map(function() {
return $(this).height();
}).get());
boxes.height(maxHeight);
$('.col-sm-12 .panel').height(maxHeight/2-22);//22 = 20 (bottom-margin) + 2 *1 (border)
});