我的目標是並排放置兩個表格。我遵循以下指導: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'裏面。 –