将表格,iframe和表格并排显示

时间:2016-02-14 01:56:47

标签: javascript html formatting line-breaks

我正在尝试并排显示表格,iframe和表格。中间没有休息或任何东西。我希望这三个中心最好。

这没有任何意义。它们有足够的空间可以在同一“线”上显示,因为我的屏幕显示足够大。

请帮忙。

代码如下所示:

<center>




<table border="0">
<tr id="hidethis" style="display:none;">
<td><iframe src="menu.html"height=450 width=400 frameborder=0 name = "list" style =""></></iframe></td>
</tr>
<tr id="hidethisalso" style="display:none;">
<td>Enter code for song to play</td>
</tr>
</table>





<iframe height=450 width=450 frameborder=0 name = "cake" style =""></></iframe>



<table border="0">
<tr id="hidethistoo" style="display:none;">
<td><iframe src="menu.html"height=450 width=400 frameborder=0 name = "list" style =""></></iframe></td>
</tr>
<tr id="hidethisaswell" style="display:none;">
<td>Enter code for song to delete</td>
</tr>
</table>

</center>

1 个答案:

答案 0 :(得分:0)

将表格换成<div style="inline-block">...</div>

这将使表格适合您

<center>
<!-- wrap the table in an inline-block to make it behave -->
<div style="display:inline-block">
<table border="0">
<tr id="hidethis" style="display:;">
<td><iframe src="menu.html"height=450 width=400 frameborder=0 name = "list" style =""></></iframe></td>
</tr>
<tr id="hidethisalso" style="display:none;">
<td>Enter code for song to play</td>
</tr>
</table>
</div>
<iframe height=450 width=450 frameborder=0 name = "cake" style =""></></iframe>
<!-- wrap the table in an inline-block to make it behave -->
<div style="display:inline-block">
<table border="0">
<tr id="hidethistoo" style="display:;">
<td><iframe src="menu.html"height=450 width=400 frameborder=0 name = "list" style =""></></iframe></td>
</tr>
<tr id="hidethisaswell" style="display:none;">
<td>Enter code for song to delete</td>
</tr>
</table>
</div>
</center>