【问题标题】:Having a table,an iframe,and a table displayed side by side有一个表格、一个 iframe 和一个表格并排显示
【发布时间】:2016-05-25 01:49:09
【问题描述】:

我正在尝试并排显示一个表格、一个 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>

【问题讨论】:

  • 你可以尝试将每个表包装在它自己的具有display:inline-block样式的div中
  • 你知道一种只使用 Javascript 和 HTML 的方法——不使用 CSS。无论如何感谢您的帮助。感谢您的宝贵时间。
  • 你有内联css,为什么解决方案不能这样做?

标签: javascript html formatting line-breaks


【解决方案1】:

将表格包裹在&lt;div style="inline-block"&gt;...&lt;/div&gt;

这将使表格适合您

<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>

【讨论】:

    猜你喜欢
    • 2012-04-24
    • 2017-03-31
    • 2021-10-25
    • 1970-01-01
    • 1970-01-01
    • 2019-01-12
    • 1970-01-01
    • 2011-08-07
    • 1970-01-01
    相关资源
    最近更新 更多