代码之家  ›  专栏  ›  技术社区  ›  SoLoGHoST

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

  •  1
  • SoLoGHoST  · 技术社区  · 15 年前

    我不能理解这里的问题,但在所有浏览器cept 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 回复  |  直到 9 年前
        1
  •  1
  •   meder omuraliev    15 年前

    我会尝试给显式css类以显式的宽度 每一个 技术总监。

    <td class="foo">

    .foo { width:200px; } .

    确保数学计算正确。

        2
  •  1
  •   Mr Lister hawi    9 年前

    Opera将列数计算为 <td> <th> 一排的标签。这意味着您始终需要一行,其中所有tds都没有colspan属性或colspan属性设置为1。添加表格布局:固定到表格样式似乎也有帮助。

    自从Opera在2013年从Presto切换到Blink渲染引擎后,这个错误就被修复了。

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

        3
  •  0
  •   hallvors    15 年前

    推荐文章