如何加速 IE6 页面/表格渲染?
编辑:感谢@Grumpy,我的问题得到了解决 - 不过,如果您有关于 IE6 的一般建议 - 请随时回答。
我有一个客户仍在使用IE6(我试图让他们升级,但由于用户基数庞大,进展缓慢)。
一页上有一个包含价格的表格(11 列,每个条目 24 行)。每个单元格中都有一个输入或选择元素。 当仅显示一个条目时,该表呈现得非常快,但是一旦有更多条目,则需要更长的时间(例如,6个条目需要>30秒)。
我知道它是表格,因为上面的所有元素都是直接可见的。我尝试通过为表格和每个单元格指定固定大小并设置 table-layout:fixed
样式来优化表格。 我还尝试为每个条目提供自己的表格,但似乎都没有帮助。
任何提示、链接或任何如何提高页面速度的想法都值得赞赏。 如果您需要更多信息,请在评论中询问。
Edit: My problem is fixed thanks to @Grumpy - still, if you have general advice regarding to IE6 - feel free to answer.
I have a customer still using IE6 (I tried to let them upgrade, but it is slowly going on because of the large user base).
On one page there are is a table containing prices (11 columns with 24 rows per entry). Each cell has either an input or select element in it.
When only one entry is shown, this table renders very fast, but as soon as there are more, it takes much longer (e.g. 6 entries take >30 seconds).
I know its the table, because all elements above are directly visible. I tried to optimize the table by giving the table and each cell a fixed size and setting the table-layout:fixed
-style.
I also tried giving each entry its own table, but neither seem to help.
Any tips, links or any ideas how to improve the page speed are appreciated.
If you need more information, please ask in the comments.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您最好避免的事情之一就是嵌套。
如果您的表格是在 div、表格等的多层中定义的,则 IE6 渲染引擎可能会显着变慢。我会尝试将您的表格单独放在一个页面上,看看渲染时间是否会大幅减少。
One of the things that you will do best to avoid is nesting.
If your table is defined within several layers of divs, tables, etc then the IE6 rendering engine may slow considerably. I'd try putting your table on a page by itself and see if there is a big decrease in the render time.
我将回答我自己的问题,因为问题不在表内,而是在它之后的脚本中,该脚本在渲染时扫描整个表。桌子越大,扫描的次数就越多。
更换脚本解决了问题。
I'll answer my own question, since the problem didn't lie within the table, but a script after it, which scanned the whole table upon rendering. The bigger the table, the more scanning was done.
Replacing the script fixed the problem.