html - HAML loses my <td> tag -
i have following haml
.x-row-tpl %tds {{#parent}}{{name}}{{/parent}} %td {{#parent}}{{name}}{{/parent}} %p {{#parent}}{{name}}{{/parent}}
it's rendered html (i mean in browser) as:
<div class="x-row-tpl"> <tds>{{#parent}}{{name}}{{/parent}}</tds> {{#parent}}{{name}}{{/parent}} <p>{{#parent}}{{name}}{{/parent}}</p> </div>
why haml skips <td>
tag on rendering?
i tried wrap :erb
, not doesn't help. tried different tag names, invalid tags (like <tds>
), working fine, except <td>
.
your html invalid following reasons:
your tag named
<tds>
, isn't valid. should<td>
.a
<td>
tag's valid parent element<tr>
.
when valid tag element in invalid location, browser free remove or move tag. when invalid tag name used, browser free whatever wants—afaik in modern browsers treated <div>
.
always sure final html passes w3c's html validator. if doesn't, you'll liable unexpected behavior.
Comments
Post a Comment