IE9表具有在随机列中偏移的随机行 [英] IE9 table has random rows which are offset at random columns

查看:105
本文介绍了IE9表具有在随机列中偏移的随机行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类别页面,当用户点击一个类别时,该类别下的项目通过jQuery Ajax调用在表格中加载,并粘贴到该类别下方的元素中。但是,似乎发生的情况是,加载表中的一行或两行将在随机列中具有其数据偏移量。我已经在IE9,FF 3.6和Chrome 13中对此进行了测试。这种情况似乎只发生在IE9中。表格数据格式完美 - 我使用Fiddler截取请求,然后查看原始html,并且它没有任何问题。

I have a page of categories, when the user clicks one, the items under that category are loaded via a jQuery Ajax call, in a table, and stuck into an element just below the category. What seems to happen though, is that one or two rows in the loaded table, will have its data offset at a random column. I have tested this in IE9, FF 3.6, and Chrome 13. This ONLY seems to happen in IE9. The tabular data is perfectly formatted - I have used Fiddler to intercept the requests and then looked at the raw html, and there's nothing wrong with it.

该网站是内置的ASP.NET MVC3。通过Ajax请求返回的表返回Razor局部视图。不幸的是,这必须在IE中工作。我真的希望有人对此有解释。

The site was built in ASP.NET MVC3. The table that is returned via the Ajax request returns a Razor partial view. This has to work in IE, unfortunately. I'm really hoping someone has an explanation for this.

这是一个例子:

和另一列的偏移量:

Here's one example: And another:

编辑[2012/03/25]:这个应用程序已离开我的手,所以我无法验证哪些答案有效。 Adam Youngers发布到 http的链接://social.msdn.microsoft.com/Forums/pl/iewebdevelopment/thread/e6f49d52-ec3f-47c5-802e-b80d1a58ed39 似乎有一些可能的解决方案。根据过去的经验,我会首先尝试这些选项..

EDIT [2012/03/25]: This application has left my hands, so I am unable to verify which of the answers work. The link that Adam Youngers posted to http://social.msdn.microsoft.com/Forums/pl/iewebdevelopment/thread/e6f49d52-ec3f-47c5-802e-b80d1a58ed39 seemed to have some possible solutions. From past experience, I would try these options first..


  1. 添加< meta http-equiv =X-UA兼容内容=IE = 8/>到页面的head元素。

  2. 尝试删除表格单元格之间的任何空白区域。例如。 < / td>< td>,而不是让新行开始下一个单元格。 (这在过去对我造成了奇怪的间距问题)


推荐答案

问题似乎白色间距。

我在 http://social.msdn.microsoft.com/Forums/en-AU/iewebdevelopment/thread/28d78780-c95c-4c35-9695-237ebb912d90

使用这样的正则表达式替换你从AJAX调用中获得的html。

Replace the html you get from the AJAX call using a regular expression like this.

var expr = new RegExp('>[ \t\r\n\v\f]*<', 'g');
tableHtml = tableHtml.replace(expr, '><');

这篇关于IE9表具有在随机列中偏移的随机行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆