【问题标题】:How to make a table row work properly in Internet Explorer?如何使表格行在 Internet Explorer 中正常工作?
【发布时间】:2012-12-06 09:18:48
【问题描述】:

我找到了一段这样的代码:

<table class="inlineH" border="0" summary="">
<tr>
<th class="select"></th>
<th class="name">My Name </th>
<th class="description">Mob Number </th>
<th class="Job">My Job</th>
</tr> 
</table>

在此之后,我有一个 for 循环,我正在使用它来迭代 div 中的另一个表,如下所示:

<%for (int x=0; x< MyNo; x++ ) {

%>
<div id="manIt">
<table>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</table>
</div>
<% }%>

这些东西在 Mozilla 中完美运行,给了我想要的东西。但是当我在 IE 中尝试时,代码会发生这种情况:

<table class="inlineH" border="0" summary="">
<tr>
<th class="select"></th>
<th class="name">My Name </th>
<th class="description">Mob Number </th>
<th class="Job">My Job<br/></th>
</tr/> 
</table>


<%for (int x=0; x< MyNo; x++ ) {

%>
<div id="manIt">
<table>
<tr>
<td>...</td/>
<td>...</td/>
<td>...</td/>
</tr/>
</table>
</div>
<% }%>

如您所见,IE 在结束标记中添加了一个额外的“/”:.我正在使用 IE8。我在这里做错了什么?

编辑:对不起IE版本。我又看了一遍,是IE 8。

请帮忙。

【问题讨论】:

  • 如果您使用的是 IE7,请升级。其他人也应该如此。在 2012 年运行旧浏览器绝对没有正当理由。即使仍然在 Windows XP 上的慢动作也可以升级到 IE9。
  • 你为什么在中使用
  • @Maritim 我同意,但我认为 XP 不支持 IE9
  • @Maritim 说得简单有效,但请告诉拥有 30 万员工且 IE6 仍然是标准且用户不能随意安装的 NHS。不幸的是,在某些情况下仍然需要支持。我默认会这样做:bbc.co.uk/news/technology-18440979
  • 我的错,IE8 是 XP 支持的最新版本。

标签: html internet-explorer jsp tags


【解决方案1】:

一种可能的解决方案是使用另一种类型的标记,例如&lt;script type="text/javascript" src="test.js"/&gt;,而不是&lt;script&gt; something &lt;/script&gt;.

【讨论】:

  • 这不是解决方案。这是 jsp 代码,您不能将其保存在 js 文件中。变得真实!
猜你喜欢
相关资源
最近更新 更多
热门标签