我的目标是并排放置两个表格。我遵循以下指导:https://stackoverflow.com/a/11690480/2402577并排html表格:<table style =“float:left;”>不起作用
<table style="float: left;">
我的示例代码:
<div class="container" id="coverpage">
<div class="row">
<table id="tableblock" class="display" width="100%" style="float:left"><caption><h3>Latest Blocks</h3></table>
<table id="tabletxs" class="display" width="100%" style="float:left"><caption><h3>Latest Transactions</h3></table>
</div>
</div>
正如你所看到的表没有地方并排。我不确定我做错了什么。我该如何解决这个问题?
有了宝贵的意见,它似乎工作,但现在桌子的高度是非常小的。完成更改:添加了<div class="col-md-10">
,删除了width
:此方法有效,但现在表格高度不对称且足够长。
<div class="container" id="coverpage">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<table id="tableblock" class="display"><caption><h3 style="color:black;">Latest Blocks</h3></caption></table>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<table id="tabletxs" class="display"><caption><h3 style="color:black;">Latest Transactions</h3></caption></table>
</div>
</div>
</div>
表输出:
感谢您宝贵的时间和帮助。
由于您使用'class'属性,请编辑您的问题,并添加CSS代码。 –
我看到你正在使用'container'和'row'。这是否意味着你正在使用Bootstrap?因为那会让一切变得更容易。 –
旁注:'h3'不能在'caption'里面。 –