2012-11-21 36 views
0

它是不好的做法或由於任何原因unkosher有一個元素內部的表標記,但在單元格外?有一個內部表中的元素,但在td之外

例如:

<table> 
    <tbody> 
     <td>Hello,</td> 
     <td>Help me I'm a table cell.</td> 
     <td>I'm just happy to be here.</td> 
    </tbody> 
    <a>close button</a> 
</table> 
+3

是的,那是不正確的標記。檢查你自己的兒子。 –

回答

1

如果您想檢查有效的HTML http://validator.w3.org/check,請使用此選項。它將顯示以下錯誤:

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). 

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error). 
+0

非常感謝,我的朋友。 –

2

是的,把它放在外面的桌子或細胞內。

0

是的。 <a>不允許直接在<table>之內。把它放在一個單元格內(<td><th>)或在表格外。您也可以使用<caption>

0

是的,它將提供一個驗證錯誤,因爲A元素不能在不允許像TABLE元件內部的上下文中找到。

相關問題