xstv shop
xstv shop

Reputation: 11

how to rectify this error (start tag "div" seen in "table")

I am creating my website. The problem is when i see demo in my browser it seems ok but view page source marked it as red with an error that start tag a seen in table. please help....

<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>

Upvotes: 1

Views: 2696

Answers (2)

Quentin
Quentin

Reputation: 943556

The only child elements a table row can have a table data cells and table header cells.

Since you don't appear to be using the table to structure tabular data, you should fix this error by removing the table entirely.

<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>

Upvotes: 1

Marcos P&#233;rez Gude
Marcos P&#233;rez Gude

Reputation: 22158

You need a TD to make a cell inside the row (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>

Note that height and width needs real values. px it's not a value. 10px is correct

Upvotes: 1

Related Questions