Possible Duplicate:
Trying to get tables next to each other horizontal可能的重复:尝试在水平位置上相邻的表
I have two html tables already created. How can I place them side by side instead of 1 above the other?
我已经创建了两个html表。我怎么能把它们并排放在一起,而不是一个在另一个上面?
4 个解决方案
#1
64
Depending on your content and space, you can use floats or inline display:
根据您的内容和空间,您可以使用float或inline display:
<table style="display: inline-block;">
<table style="float: left;">
Check it out here: http://jsfiddle.net/SM769/
看看这里:http://jsfiddle.net/SM769/
Documentation
文档
- CSS
display
on MDN - https://developer.mozilla.org/en/CSS:display - 在MDN上显示CSS: https://developer.mozilla.org/en/CSS:显示
- CSS
float
on MDN - https://developer.mozilla.org/en/CSS/float - CSS在MDN上浮动- https://developer.mozilla.org/en/CSS/float。
#2
5
You can place your tables in a div and add style to your table "float: left"
您可以将您的表放在一个div中,并为您的表添加样式“float: left”
<div>
<table style="float: left">
<tr>
<td>..</td>
</tr>
</table>
<table style="float: left">
<tr>
<td>..</td>
</tr>
</table>
</div>
or simply use css:
或者干脆使用css:
div>table {
float: left
}
#3
1
<div style="float: left">
<table>
<tr>
<td>..</td>
</tr>
</table>
</div>
<div style="float: left">
<table>
<tr>
<td>..</td>
</tr>
</table>
</div>
#4
0
With CSS: table {float:left;}
?
使用CSS: table {float:left;} ?
#1
64
Depending on your content and space, you can use floats or inline display:
根据您的内容和空间,您可以使用float或inline display:
<table style="display: inline-block;">
<table style="float: left;">
Check it out here: http://jsfiddle.net/SM769/
看看这里:http://jsfiddle.net/SM769/
Documentation
文档
- CSS
display
on MDN - https://developer.mozilla.org/en/CSS:display - 在MDN上显示CSS: https://developer.mozilla.org/en/CSS:显示
- CSS
float
on MDN - https://developer.mozilla.org/en/CSS/float - CSS在MDN上浮动- https://developer.mozilla.org/en/CSS/float。
#2
5
You can place your tables in a div and add style to your table "float: left"
您可以将您的表放在一个div中,并为您的表添加样式“float: left”
<div>
<table style="float: left">
<tr>
<td>..</td>
</tr>
</table>
<table style="float: left">
<tr>
<td>..</td>
</tr>
</table>
</div>
or simply use css:
或者干脆使用css:
div>table {
float: left
}
#3
1
<div style="float: left">
<table>
<tr>
<td>..</td>
</tr>
</table>
</div>
<div style="float: left">
<table>
<tr>
<td>..</td>
</tr>
</table>
</div>
#4
0
With CSS: table {float:left;}
?
使用CSS: table {float:left;} ?