【发布时间】:2012-11-03 08:52:39
【问题描述】:
在我的网站上:www.metallica-gr.net 您可以看到主表有 3 列。
第一列(左):垂直图像
第二栏(中):主要内容
3d 柱(右):垂直图像
问题是,因为右图位于代码的底部(因为它是表格的最后一列),它会等待主要内容加载后才出现。所以在网站加载之前它看起来很乱,因为布局的只有一个边框出现。
我不能为此使用 div,因为我已经制作了很多 html 页面,而且当我尝试时也没有成功。有没有什么办法解决这一问题?代码如下:
index.html:
<table border="0" cellspacing="0" cellpadding="0" id="main" align="center">
<tr>
<td width="2" valign="top"><?php include "vertical.php"?></td>
<td valign="top" style="vertical-align:top;">
<div><?php include "main.html"?></div></td>
<td width="2" valign="top"><?php include "vertical.php"?></td>
</tr>
</table>
vertical.php:
<div style="background-image:url(images/vertical.jpg); width:2px; height:100%; background-repeat:repeat-y; vertical-align:top; position:fixed; top:0;"></div>
【问题讨论】:
-
你在
.html文档中使用include()吗? -
您正在使用表格进行布局。强烈不建议这样做,并且在不久的将来会让您非常头疼。
-
@Kumar - 你是什么意思?使用的代码在上面。 - Uchiha 正如我所说,我尝试了 div 方法,但我遇到了一些问题。通过使用表格作为特定网站的布局,我没有发现任何其他问题。如果有人可以推荐解决方案,请告诉我。
-
嗨,Zefs,您指的是共享按钮部分吗?而且你想加载页面加载的那部分,而不是最后,对吧?
-
不,不是那样。表格边框(布局的左右图像)。右一个在加载主要内容后加载,因为它的代码位于主要内容下方。
标签: php html html-table include load