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:

  1. your tag named <tds>, isn't valid. should <td>.

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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -