Re: dynamic change to rowspan?

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
On 9/30/09 5:33 PM, Marco Mariani wrote:
> I have a very dynamic table and I reckon Firefox does not honor the
> changing of rowspan, in order to add/delete rows.

Works fine over here.

> Any suggestion?

Fix the bug in your code (see below)?

> <table id="mytable">
...
> table.appendChild(tr);

This puts the <tr> as a direct child of the <table>, whereas the other 
<tr> is a child of the <tbody>.  That means they're in different row 
groups, and rowspans do not cross rowgroup boundaries (see 
http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#table-model 
or http://www.w3.org/TR/html401/struct/tables.html#adef-rowspan).

table.tBodies[0].appendChild(tr) will give you the behavior you seem to 
want.

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.