W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

HTMLTableElement.insertRow()

From: Miles Sabin <msabin@cromwellmedia.co.uk>
Date: Wed, 7 Oct 1998 13:50:20 +0100
Message-ID: <c=US%a=_%p=Cromwell_Media%l=ODIN-981007125020Z-10661@odin.cromwellmedia.co.uk>
To: "'DOM list'" <www-dom@w3.org>
According to the spec:

  insertRow
    Insert a new empty row in the table. [...]

    Parameters
      index      The row number where to insert a new row.

What should the behaviour be if the table currently has
less than (value of) index rows? Should the new row be
added at the end; or should all the intervening rows be
inserted?

My preference is for the latter, on the grounds that the
following conditional should always be true,

  HTMLElement newRow = someTable.insertRow(index);

  if(((HTMLTableRowElement)newRow).getRowIndex() == index)
    // should always be true

Alternatively, the insertion interface on HTMLTableElement
might be better if modified to match that of
HTMLSelectElement ... but I realize it's far too late for
that now :-(

Cheers,


Miles

-- 
Miles Sabin                          Cromwell Media
Internet Systems Architect           5/6 Glenthorne Mews
+44 (0)181 410 2230                  London, W6 0LJ
msabin@cromwellmedia.co.uk           England
Received on Wednesday, 7 October 1998 08:54:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT