2015-10-14 27 views
0

我正在创建我的网站。问题是,当我在浏览器中看到演示程序时,它看起来没问题,但查看页面源代码将其标记为红色,并显示一个在表格中看到的开始标记的错误。请帮助....如何纠正这个错误(在“表”中看到开始标记“div”)

<table width="165" border="0" align="right" cellpadding="0" cellspacing="0"> 
    <tr> 
    <div style="_height:px; width:px;background-color:#FFFFFF;font-family:Arial; border: 1px solid #FFFFFF; text-align:justify;"> 
     <a href="http://www.amazon.com/" style="font-size:16px;text-decoration:none; color: #87A800;">This is a sample text</a> 
    </div> 
     </tr> 
    <tr> 
     <td>&nbsp;</td> 
     </tr> 
    </table> 
+0

看穿你是否已经正确,为了 –

+0

关闭所有标签请谁的你在浏览器中源视图(截图) –

+0

好,股利不应该在那里,在它包装看到一个例子的' td',因为'tr'只能是'td'或'th'元素的父项。 – pawel

回答

0

你需要一个TD,这样可使行(TR)内的细胞

<table width="165" border="0" align="right" cellpadding="0" cellspacing="0"> 
    <tr> 
    <td> 
    <div style="background-color:#FFFFFF;font-family:Arial; border: 1px solid #FFFFFF; text-align:justify;"> 
     <a href="http://www.amazon.com/" style="font-size:16px;text-decoration:none; color: #87A800;">This is a sample text</a> 
    </div> 
     </td> 
     </tr> 
    <tr> 
     <td>&nbsp;</td> 
     </tr> 
    </table> 

注意高度和宽度需要真正的价值。 px这不是一个价值。 10px是正确的

0

唯一的子元素表行可以有一个表数据单元格和表格标题单元格。

由于您似乎没有使用该表来构造表格数据,因此您应该通过完全删除该表来修复此错误。

<div style="background-color:#FFFFFF;font-family:Arial; border: 1px solid #FFFFFF; text-align:justify;"> 
    <a href="http://www.amazon.com/" style="font-size:16px;text-decoration:none; color: #87A800;">This is a sample text</a> 
</div> 
相关问题