Opera浏览器中的Colspans无法正常工作

时间:2010-09-28 01:07:10

标签: html html-table opera

我无法理解这里的问题,但是在所有浏览器中看起来都很好看。

HTML代码如下:

<table width="395" height="214" border="1">
  <tr>
    <td colspan="2">Here is some content in here that has 2 colspans</td>
    <td width="137">This only has 1 colspan.</td>
  </tr>
  <tr>
    <td width="113">This has only 1 colspan also.</td>
    <td colspan="2">This cell has 2 colspans now and should look presentable hopefully.</td>
  </tr>
  <tr>
    <td colspan="3">This cell has 3 colspans within this table and should fill up the entire width of the table.</td>
  </tr>
</table>

现在,输出在Opera中显示如下:

alt text

但是如何让它看起来像这样(就像所有其他浏览器一样): alt text

问题实际上比这更深刻,但这是主要的基本问题。

3 个答案:

答案 0 :(得分:1)

我会尝试将显式宽度的显式css类提供给每个 td。

<td class="foo">

.foo { width:200px; }

确保数学正确加起来。

答案 1 :(得分:1)

Opera 9,10,11和12中存在此错误。

Opera会将列数计算为一行中<td><th>个标记的最大数量。这意味着您总是需要一行,其中所有tds都没有colspan属性或者colspan属性设置为1.添加table-layout:固定到表格样式似乎也有帮助。

自从Opera于2013年从Presto切换到Blink渲染引擎后,此错误已得到解决。

http://www.crydust.be/test/opera_table_colspan_bug/

答案 2 :(得分:0)

好像是一个错误: - /我找到了你的错误报告,谢谢。我想你需要一个黑客,你添加一行具有预期的总细胞数,并将其设置为隐形..: - (

相关问题