Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Opera浏览器中的Colspans无法正常工作_Html_Html Table_Opera - Fatal编程技术网

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

Html Opera浏览器中的Colspans无法正常工作,html,html-table,opera,Html,Html Table,Opera,我不能理解这里的问题,但除了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&

我不能理解这里的问题,但除了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>

这里有一些内容有两个colspan
这个只有1个colspan。
这也只有1个colspan。
这间牢房现在有2个Colspan,希望看起来还不错。
此单元格在此表格中有3个colspans,应填满表格的整个宽度。
现在,Opera中的输出如下所示:

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


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

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

.foo{width:200px;}


确保计算结果正确。

好像是个错误:-/我找到了你的错误报告,谢谢。我想你需要一个hack,在其中添加一行,该行具有预期的单元格总数,并将其样式设置为不可见..:-(

此错误存在于Opera 9、10、11和12中

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

自从Opera在2013年从Presto切换到Blink渲染引擎以来,该错误已得到修复


如果您明确指定
colspan=“1”,是否有帮助
对于其他单元格?不,这没有什么区别,但无论如何都要感谢。如果你问我的话,在表的开头添加一个元素,其中所有元素的宽度都合适,这似乎有点草率。Opera需要支持这一点。我知道Opera没有其他浏览器那么老,但他们需要使用pr如果你问我的话,我会说的!!