473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

ie6 Insert Row at specific Row Index of Table

Can someone show me how to insert a row at any given row index of an
already created table? It only has to work in IE6 (used on intranet at
work).

Specifically, if a table is 20 rows in total (thought his will vary),
and someone wants to insert a new row at row 5, i need for one row to
be added, and each of the rows from 5-20 to be "cloned" to 6-21.

The contents of row 5 may vary as well; it is not a straight copy of an
exisiting row.

I have seen something that did this very thing, but it used innerHTML,
and I have read this is inavisable for tables.

Thanks,
Ann

Feb 5 '06 #1
28 18474
Giggle Girl wrote:
Can someone show me how to insert a row at any given row index of an
already created table? It only has to work in IE6 (used on intranet at
work).

Specifically, if a table is 20 rows in total (thought his will vary),
and someone wants to insert a new row at row 5, i need for one row to
be added, and each of the rows from 5-20 to be "cloned" to 6-21.

Locate the table element in the DOM and use insertRow( index ) to insert
the row.

--
Ian Collins.
Feb 5 '06 #2
Ian Collins wrote:
Giggle Girl wrote:
Can someone show me how to insert a row at any given row index of an
already created table? It only has to work in IE6 (used on intranet at
work).

Specifically, if a table is 20 rows in total (thought his will vary),
and someone wants to insert a new row at row 5, i need for one row to
be added, and each of the rows from 5-20 to be "cloned" to 6-21.

Locate the table element in the DOM and use insertRow( index ) to insert
the row.


And be sure that you insert it as child element of a `thead' or `tbody'
element.
PointedEars
Feb 5 '06 #3
Thomas 'PointedEars' Lahn wrote:
Specifically, if a table is 20 rows in total (thought his will vary),
and someone wants to insert a new row at row 5, i need for one row to
be added, and each of the rows from 5-20 to be "cloned" to 6-21.


Locate the table element in the DOM and use insertRow( index ) to insert
the row.


And be sure that you insert it as child element of a `thead' or `tbody'
element.

Unnecessary and I think plain wrong, insertRow is an HTMLTableElement
method and it adds a tbody if the table is empty. Otherwise it will add
to the table section corresponding to the index.

Try this:

HTML:

<table id='test1'>
</table>
<table id='test2'>
<tbody>
<tr>
<td name='cell0'/>
<tr>
<tr>
<td name='cell1'/>
<tr>
<tbody>
</table>

Script:

var test1 = document.getElementById('test1');

test1.insertRow(-1);

alert(test1.innerHTML);

var test2 = document.getElementById('test2');

var row = test2.insertRow(1);
var cell = row.insertCell(-1);
cell.name = 'cell2';

alert(test2.innerHTML);

--
Ian Collins.
Feb 5 '06 #4
Ian Collins wrote:
Thomas 'PointedEars' Lahn wrote:
Specifically, if a table is 20 rows in total (thought his will vary),
and someone wants to insert a new row at row 5, i need for one row to
be added, and each of the rows from 5-20 to be "cloned" to 6-21.
Locate the table element in the DOM and use insertRow( index ) to insert
the row. And be sure that you insert it as child element of a `thead' or `tbody'
element.


Unnecessary and I think plain wrong, insertRow is an HTMLTableElement
method and it adds a tbody if the table is empty.


I remember to have read here that the latter does not happen in all DOMs,
especially I remember to have read here that it does not happen in the IE
DOM. Maybe I remember incorrectly.
Otherwise it will add to the table section corresponding to the index.

Try this:

HTML:

<table id='test1'>
</table>
This is not Valid (X)HTML. The `table' element requires at least the
`tbody' element in HTML, and although its start and end tags are optional
in HTML, its content model requires the `tr' element. In XHTML, the
content model of the `table' element requires at least one `tbody' or
one `tr' element.
<table id='test2'>
<tbody>
<tr>
<td name='cell0'/>
This is not Valid (X)HTML, `td' elements do not have a `name' attribute.
The SHORTTAG syntax used is equivalent to

<td name='cell0'>&gt;</td>

in HTML, and not recommended for XHTML per XML (as the `td' element is
not declared EMPTY there).
<tr>
<tr>
This is not Valid (X)HTML, the `tr' element's content model requires the
`th' or `td' element. In XHTML, the close tag is not optional.
<td name='cell1'/>
<tr>
See above.
<tbody>
</table>

Script:

var test1 = document.getElementById('test1');
test1.insertRow(-1);
These lack the previous feature test.
<URL:http://pointedears.de/scripts/test/whatami>
<URL:http://www.jibbering.com/faq/faq_notes/not_browser_detect.html>
alert(test1.innerHTML); ^^^^^^^^^^
This is even more proprietary.
var test2 = document.getElementById('test2');
var row = test2.insertRow(1);
var cell = row.insertCell(-1);
cell.name = 'cell2';
alert(test2.innerHTML);


An (X)HTML `td' element does not have a `name' attribute, and so
an HTMLTableCellElement object does not have a `name' property.
As DOM element objects are exposed as host objects to the script
engine, this has potential to break the script.

See above for the rest.
PointedEars
Feb 5 '06 #5
Locate the table element in the DOM and use insertRow( index ) to insert
the row.


And doing so will automatically "bump" all rows thereafter? (No need
for me to manually do it?)

If that is the case, awesome! If not, do you have some code I can see
that does it?

Thanks so much,
Ann

Feb 5 '06 #6
Thomas 'PointedEars' Lahn wrote:
And be sure that you insert it as child element of a `thead' or `tbody'
element.
Unnecessary and I think plain wrong, insertRow is an HTMLTableElement
method and it adds a tbody if the table is empty.

I remember to have read here that the latter does not happen in all DOMs,
especially I remember to have read here that it does not happen in the IE
DOM. Maybe I remember incorrectly.

If you'd tried the mickey mouse example (rather than pulling it apart)
you would have seen that it does work in IE (the OP's requirement).
<table id='test1'>
</table>

This is not Valid (X)HTML. The `table' element requires at least the
`tbody' element in HTML, and although its start and end tags are optional
in HTML, its content model requires the `tr' element. In XHTML, the
content model of the `table' element requires at least one `tbody' or
one `tr' element.

I don't care, it was a quick demo. The web is full of such
non-conforming code and browsers cope with it. If you try it, you will
see than IE automatically inserts the tbody.
alert(test1.innerHTML);
^^^^^^^^^^
This is even more proprietary.

It's a demo for IE for goodness sake.

An (X)HTML `td' element does not have a `name' attribute, and so
an HTMLTableCellElement object does not have a `name' property.
As DOM element objects are exposed as host objects to the script
engine, this has potential to break the script.

That was a typo.

--
Ian Collins.
Feb 5 '06 #7
Giggle Girl wrote:
Locate the table element in the DOM and use insertRow( index ) to insert
the row.

And doing so will automatically "bump" all rows thereafter? (No need
for me to manually do it?)

Yes, as the name suggests, it inserts a row.

--
Ian Collins.
Feb 5 '06 #8
Thomas 'PointedEars' Lahn wrote:
Ian Collins wrote:

Thomas 'PointedEars' Lahn wrote:
>Specifically, if a table is 20 rows in total (thought his will vary),
>and someone wants to insert a new row at row 5, i need for one row to
>be added, and each of the rows from 5-20 to be "cloned" to 6-21.

Locate the table element in the DOM and use insertRow( index ) to insert
the row.

And be sure that you insert it as child element of a `thead' or `tbody'
element.


Unnecessary and I think plain wrong, insertRow is an HTMLTableElement
method and it adds a tbody if the table is empty.

I remember to have read here that the latter does not happen in all DOMs,
especially I remember to have read here that it does not happen in the IE
DOM. Maybe I remember incorrectly.


If adding rows using document.createElement() and appendChild(), some
browsers (e.g. IE) require that you append it to a tbody element - other
browsers (e.g. Gecko & KHTML based browsers) let you append it to the table.

However, insertRow() is a method of the HTMLTableSectionElement. The
new row is created as a child of the table element, a append separate
append is not required.

<URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-93995626>

[...]

--
Rob
Feb 5 '06 #9
VK

RobG wrote:
If adding rows using document.createElement() and appendChild(), some
browsers (e.g. IE) require that you append it to a tbody element - other
browsers (e.g. Gecko & KHTML based browsers) let you append it to the table.


Not totally right.
IE automatically creates at least one tbody element during the initial
page parsing. So either you added <tbody> tag or not you still have
tBody section and appendChild will add rows to there.
At the same time <thead> and <tfoot> elements are not created
automatically, so in order to insert rows to tHead or tFoot you have to
mark up your table in advance (or create header and footer
pragrammatically)

Other browsers do not create tBody automatically. On attempt to insert
a row to a table without <tbody> section three outcomes are possible:
1) the operation will fail
2) new row is added as direct child of table
3) on the first attempt to insert a row tBody section is created and
new row is added as a child if it (namely emulation of IE behavior).

While the 3rd one is currently the winning one, but all three outcomes
are still possible between different *rather modern* browsers and
versions.

This is why I'd like to repeat: if one plans to script a table, always
markup <thead>, <tfoot> and <tbody> manyally, do not trust the parser.

If you do not plan to script the table (add/remove/sort rows) then
<thead>, <tfoot> and <tbody> can be securely omited.

Feb 6 '06 #10
VK wrote:
RobG wrote:
If adding rows using document.createElement() and appendChild(), some
browsers (e.g. IE) require that you append it to a tbody element - other
browsers (e.g. Gecko & KHTML based browsers) let you append it to the table.

Not totally right.
IE automatically creates at least one tbody element during the initial
page parsing. So either you added <tbody> tag or not you still have
tBody section and appendChild will add rows to there.
At the same time <thead> and <tfoot> elements are not created
automatically, so in order to insert rows to tHead or tFoot you have to
mark up your table in advance (or create header and footer
pragrammatically)

Other browsers do not create tBody automatically. On attempt to insert
a row to a table without <tbody> section three outcomes are possible:
1) the operation will fail
2) new row is added as direct child of table
3) on the first attempt to insert a row tBody section is created and
new row is added as a child if it (namely emulation of IE behavior).

3 is the specified action for HTMLTableElement.insertRow(), provided you
don't specify a row greater than 0.
While the 3rd one is currently the winning one, but all three outcomes
are still possible between different *rather modern* browsers and
versions.

Works in Firefox and Opera, which browsers don't work as expected?

--
Ian Collins.
Feb 6 '06 #11
VK wrote:
RobG wrote:
If adding rows using document.createElement() and appendChild(), some
browsers (e.g. IE) require that you append it to a tbody element - other
browsers (e.g. Gecko & KHTML based browsers) let you append it to the table.

Not totally right.


The language was not perfect, but it is correct. In IE you must append a
row created with createElement to a tbody (or thead or tfoot) element. In
other browsers, you can add it to the table - where it will be appended as
the last child of the first tbody element.

IE automatically creates at least one tbody element during the initial
page parsing. So either you added <tbody> tag or not you still have
tBody section and appendChild will add rows to there.
Which is the correct behaviour for any standards compliant browser. A
tbody element is mandatory, the tags aren't.

At the same time <thead> and <tfoot> elements are not created
automatically, so in order to insert rows to tHead or tFoot you have to
mark up your table in advance (or create header and footer
pragrammatically)
Of course. thead and tfoot elements only exist if you put them in the
markup or create them using script. Otherwise they won't exist.


Other browsers do not create tBody automatically.
Which ones? If they don't, they aren't compliant with HTML 4.

On attempt to insert
a row to a table without <tbody> section three outcomes are possible:
1) the operation will fail
If the browser supports insertRow (which was part of DOM 1 in 1998), then
it should not fail. If it's not supported, feature testing should detect
that and some other solution should be attempted.

2) new row is added as direct child of table
In which browser? Any I've tested *always* create a tbody even if the tags
aren't coded in the HTML source, as per the HTML 4 specification.

3) on the first attempt to insert a row tBody section is created and
new row is added as a child if it (namely emulation of IE behavior).
Rubbish. The tbody is created when the HTML source for the table is
parsed, whether the tags are there or not because that is what the HTML 4
spec says should happen. It is not created as a result of using insertRow.

That IE has the same behaviour as other browsers doesn't mean they are
emulating IE, it just means IE follows the spec.

head and body tags are optional but the elements aren't, is that an
emulation of IE too?

While the 3rd one is currently the winning one, but all three outcomes
are still possible between different *rather modern* browsers and
versions.
Please state any modern browser that does either 1 or 2.


This is why I'd like to repeat: if one plans to script a table, always
markup <thead>, <tfoot> and <tbody> manyally, do not trust the parser.
That is not good advice. thead and tfoot are only required if you actually
use them, they aren't allowed to be empty so if you don't have any need for
them, don't code them. tbody *tags* are not mandatory, read the spec.

If you do not plan to script the table (add/remove/sort rows) then
<thead>, <tfoot> and <tbody> can be securely omited.


They can be securely omitted anyway.

--
Rob
Feb 6 '06 #12
Ian Collins wrote:
Thomas 'PointedEars' Lahn wrote:
And be sure that you insert it as child element of a `thead' or `tbody'
element.
Unnecessary and I think plain wrong, insertRow is an HTMLTableElement
method and it adds a tbody if the table is empty.

I remember to have read here that the latter does not happen in all DOMs,
especially I remember to have read here that it does not happen in the IE
DOM. Maybe I remember incorrectly.


If you'd tried the mickey mouse example (rather than pulling it apart)
you would have seen that it does work in IE (the OP's requirement).


I do not have IE here, and it remains to be seen if it works in _all_ IE
versions on all possible platforms (the OP's requirement was IE_6_ only).
<table id='test1'>
</table>

This is not Valid (X)HTML. The `table' element requires at least the
`tbody' element in HTML, and although its start and end tags are optional
in HTML, its content model requires the `tr' element. In XHTML, the
content model of the `table' element requires at least one `tbody' or
one `tr' element.


I don't care, it was a quick demo. The web is full of such
non-conforming code and browsers cope with it. If you try it, you will
see than IE automatically inserts the tbody.


Scripting, especially DOM scripting, operating from within and on not Valid
markup has been proven to be inherently unreliable. Examples/demos should
be Valid or they are next to useless.
PointedEars
Feb 6 '06 #13
Ian Collins wrote :
which browsers don't work as expected?


InsertRow() is not working accordingly
http://www.gtalbot.org/BrowserBugsSe...otWorking.html

Everything was nicely reported at IE 6 programming bug wiki page.
Search for
"insertRow() in iteration loop does not work"
at
http://channel9.msdn.com/wiki/defaul...rogrammingBugs

Gérard
--
remove blah to email me
Feb 6 '06 #14
Thomas 'PointedEars' Lahn wrote :
Ian Collins wrote:


HTML:

<table id='test1'>
</table>


This is not Valid (X)HTML. The `table' element requires at least the
`tbody' element in HTML, and although its start and end tags are optional
in HTML, its content model requires the `tr' element. In XHTML, the
content model of the `table' element requires at least one `tbody' or
one `tr' element.
<table id='test2'>
<tbody>
<tr>
<td name='cell0'/>


This is not Valid (X)HTML, `td' elements do not have a `name' attribute.
The SHORTTAG syntax used is equivalent to

<td name='cell0'>&gt;</td>

in HTML, and not recommended for XHTML per XML (as the `td' element is
not declared EMPTY there).
<tr>
<tr>


This is not Valid (X)HTML, the `tr' element's content model requires the
`th' or `td' element. In XHTML, the close tag is not optional.
<td name='cell1'/>
<tr>


See above.
<tbody>
</table>

Script:

var test1 = document.getElementById('test1');
test1.insertRow(-1);


These lack the previous feature test.
<URL:http://pointedears.de/scripts/test/whatami>


The page at the above url has validation errors. Isn't strange to see
people like 'PointedEars' telling others about valid webpage when most
of his own website pages fail to pass validation and they don't even use
a strict DTD.

When someone like Thomas 'PointedEars' Lahn has well above 500
validation markup errors on his site, then he should fix these instead
of lecturing others about valid HTML.

Gérard
--
remove blah to email me
Feb 6 '06 #15
Ok, I have successfull used insertRow to put a row into my table.
Trouble is, I don't know how to put cell content there! Can someone
show me working code that inserts a row that looks like this:

<tr id="tree_row_3">
<td width="20" height="20">&nbsp;</td>
<td width="20" height="20"><img src="../images/icon_join.gif"
width="19" height="16" /></td>
<td width="20" height="20"><img src="../images/icon_ok.gif"
width="16" height="16" /></td>
<td colspan="7">Three</td>
</tr>

Thanks so much!

Ann
PS: I have spent an hour googling "HTMLTableElement insertRow" and can
find only the theory behind it, not working examples...

Feb 6 '06 #16
Giggle Girl wrote :
Ok, I have successfull used insertRow to put a row into my table.
Trouble is, I don't know how to put cell content there! Can someone
show me working code that inserts a row that looks like this:

<tr id="tree_row_3">
<td width="20" height="20">&nbsp;</td>
<td width="20" height="20"><img src="../images/icon_join.gif"
width="19" height="16" /></td>
<td width="20" height="20"><img src="../images/icon_ok.gif"
width="16" height="16" /></td>
<td colspan="7">Three</td>
</tr>

Thanks so much!

Ann
PS: I have spent an hour googling "HTMLTableElement insertRow" and can
find only the theory behind it, not working examples...


Study this example:
Dynamically creating, populating and inserting a table
http://www.gtalbot.org/DHTMLSection/CreatingTable.html

Please don't forget to read my copyright notice.
http://www.gtalbot.org/Varia/CopyrightNotice.html

Gérard
--
remove blah to email me
Feb 6 '06 #17
Thomas 'PointedEars' Lahn wrote:
Scripting, especially DOM scripting, operating from within and on not Valid
markup has been proven to be inherently unreliable. Examples/demos should
be Valid or they are next to useless.

How can I show IE adding the missing element if I include it in the markup?

--
Ian Collins.
Feb 6 '06 #18
Giggle Girl wrote:
Ok, I have successfull used insertRow to put a row into my table.
Trouble is, I don't know how to put cell content there! Can someone
show me working code that inserts a row that looks like this:

<tr id="tree_row_3">
<td width="20" height="20">&nbsp;</td>
<td width="20" height="20"><img src="../images/icon_join.gif"
width="19" height="16" /></td>
<td width="20" height="20"><img src="../images/icon_ok.gif"
width="16" height="16" /></td>
<td colspan="7">Three</td>
</tr>

Thanks so much!

Ann
PS: I have spent an hour googling "HTMLTableElement insertRow" and can
find only the theory behind it, not working examples...


HTMLTableElement.insertRow() returns an HTMLElement (the new row). You
can use insertCell() to add a cell, see my example.

--
Ian Collins.
Feb 6 '06 #19
RobG wrote:
3) on the first attempt to insert a row tBody section is created and
new row is added as a child if it (namely emulation of IE behavior).

Rubbish. The tbody is created when the HTML source for the table is
parsed, whether the tags are there or not because that is what the HTML
4 spec says should happen. It is not created as a result of using
insertRow.

Not rubbish, it depends on the context. If you are building a table in
script, the tbody will be added when you add the first row, try:

var table = document.createElement('table');
alert(table.childNodes.length);
row = table.insertRow(-1);
alert(table.childNodes.length);
alert(table.firstChild.nodeName);

A conforming browser will alert TBODY.

--
Ian Collins.
Feb 6 '06 #20
Ian Collins wrote:
RobG wrote:
3) on the first attempt to insert a row tBody section is created and
new row is added as a child if it (namely emulation of IE behavior).


Rubbish. The tbody is created when the HTML source for the table is
parsed, whether the tags are there or not because that is what the
HTML 4 spec says should happen. It is not created as a result of
using insertRow.

Not rubbish, it depends on the context. If you are building a table in
script, the tbody will be added when you add the first row, try:


The bit that is rubbish is the phrase 'emulation of IE behavior' - it is
conforming to the W3 DOM 2 specification.

<URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-39872903>
Your point is valid, but the discussion wasn't about building a table
with script, it was about inserting a new row into an existing table and
in that context the tbody already exists.

It is also interesting to compare the behaviour of different browsers
when adding a row using the HTMLTableElement::insertRow method and the
Node::appendChild method.

insertRow is 'safer' as in conforming browsers it automatically handles
the tbody issue. When adding rows with appendChild, not all browsers
will handle adding the row to a table (e.g. IE), they require the row to
be explicitly added to a tbody (or other table section). appendChild
might be more widely supported and is a reasonable first fallback.

If you have a table with more than one section (say with a thead, tfoot
or multiple tbodys) then you should get a reference to the correct table
section anyway to add the row - otherwise insertRow will just add the
row to the last tbody element.

[...]
--
Rob
Feb 7 '06 #21
Gérard Talbot wrote:
Ian Collins wrote :
which browsers don't work as expected?

InsertRow() is not working accordingly
http://www.gtalbot.org/BrowserBugsSe...otWorking.html


If you add the tbody to the table *before* using insertRow, it works
fine (or add the rows to the table instead...).
[...]
--
Rob
Feb 7 '06 #22
RobG wrote :
Gérard Talbot wrote:
Ian Collins wrote :
which browsers don't work as expected?

InsertRow() is not working accordingly
http://www.gtalbot.org/BrowserBugsSe...otWorking.html

If you add the tbody to the table *before* using insertRow, it works
fine (or add the rows to the table instead...).


Yep. It works. Amazing.

I still think MSIE 6 and MSIE 7 beta 2 are buggy on this though.

Gérard
--
remove blah to email me
Feb 7 '06 #23
RobG wrote:

The bit that is rubbish is the phrase 'emulation of IE behavior' - it is
conforming to the W3 DOM 2 specification.
OK.
insertRow is 'safer' as in conforming browsers it automatically handles
the tbody issue. When adding rows with appendChild, not all browsers
will handle adding the row to a table (e.g. IE), they require the row to
be explicitly added to a tbody (or other table section). appendChild
might be more widely supported and is a reasonable first fallback.
OK.
If you have a table with more than one section (say with a thead, tfoot
or multiple tbodys) then you should get a reference to the correct table
section anyway to add the row - otherwise insertRow will just add the
row to the last tbody element.

Doesn't it (insertRow) add the row to the section containing the
previous row?
--
Ian Collins.
Feb 7 '06 #24
Ian Collins wrote:
Thomas 'PointedEars' Lahn wrote:
Scripting, especially DOM scripting, operating from within and on not
Valid markup has been proven to be inherently unreliable. Examples/demos
should be Valid or they are next to useless.


How can I show IE adding the missing element if I include it in the
markup?


For example by counting the rows of the table afterwards.
PointedEars
Feb 7 '06 #25
Ian Collins wrote:
RobG wrote:
If you have a table with more than one section (say with a thead, tfoot
or multiple tbodys) then you should get a reference to the correct table
section anyway to add the row - otherwise insertRow will just add the
row to the last tbody element.


Doesn't it (insertRow) add the row to the section containing the
previous row?


At least it is specified so.

<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-39872903>
PointedEars
Feb 7 '06 #26
Ian Collins wrote:
RobG wrote: [...]
If you have a table with more than one section (say with a thead,
tfoot or multiple tbodys) then you should get a reference to the
correct table section anyway to add the row - otherwise insertRow will
just add the row to the last tbody element.

Doesn't it (insertRow) add the row to the section containing the
previous row?


I think you mean at the nominated table row index - so yes. I was
playing with -1 so it always went at the end.

The TR's rowIndex property is in respect to the table as a whole, but
when inserting in a section (e.g. objTbody.insertRow(i)), the index is
in relation to the section.

--
Rob
Feb 7 '06 #27
Thomas 'PointedEars' Lahn wrote:
Ian Collins wrote:

Thomas 'PointedEars' Lahn wrote:
Scripting, especially DOM scripting, operating from within and on not
Valid markup has been proven to be inherently unreliable. Examples/demos
should be Valid or they are next to useless.


How can I show IE adding the missing element if I include it in the
markup?

For example by counting the rows of the table afterwards.

Not a lot of use when the missing element is a tbody....

--
Ian Collins.
Feb 7 '06 #28
Ian Collins wrote:
Thomas 'PointedEars' Lahn wrote:
Ian Collins wrote:
Thomas 'PointedEars' Lahn wrote:
Scripting, especially DOM scripting, operating from within and on not
Valid markup has been proven to be inherently unreliable.
Examples/demos should be Valid or they are next to useless.
How can I show IE adding the missing element if I include it in the
markup?

For example by counting the rows of the table afterwards.

Not a lot of use when the missing element is a tbody....


Actually, the `tbody' element is never missing if there is a `table'
element. It is its tags that are missing since they are both optional,
and, depending on the DOM, the respective element object in the document
tree that is therefore missing.

To detect if this object was included in the document tree only because
of calling insertRow() or another table-related DOM method, it would be
sufficient to call getElementsByTagName("tbody") for the HTMLTableElement
object before and after calling the DOM method, and examining its
properties (`length', for example).
PointedEars
Feb 7 '06 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doron | last post by:
is there a setting that will ebnable uniform extent allocation upon creation of index/table by default ? if there isn't any default setting can you code it in? thanks, Doron
1
by: Jay | last post by:
Hi I have a huge table with over 100million records and on regular basis ineed to delete nearly a million records and insert a million records. Currently I delete indexes before going through the...
0
by: crypto_solid via AccessMonster.com | last post by:
I have been using a SQL database with a VB5 frontend for about 5 years. Works well. Unfortunately I don't have access to the source code. I was tasked with implementing a "job entry" application...
1
by: Daniele | last post by:
Hi, how is it possible to create a full-text index table? Thanks, Daniele
1
by: Bill Nguyen | last post by:
Below is the content of a textbox after data was captured from a barcode scanner. Instead of saving it into a text file and process later, I would like to be able to read the items (delimited by...
1
by: technocraze | last post by:
Hi guys, I am having trouble resolving this error. Below mentioned is my code and implmentation. MS Acess is my front end and sql server is my backend. What i want to achieve is to be...
7
gcoaster
by: gcoaster | last post by:
Hello Gurus, I am stuck! this will be easy I am sure for you. I have a Text Box where I type In a name. I am trying to get that value to insert into another table when I TAB to the next...
3
by: grumpygit | last post by:
Hi. I am trying to get the columns in the navigation/index table to all be the same width on the page in link below. Code in attached .zip file Any advice would be greatly appreciated as I am a...
1
by: chennaibala | last post by:
hi frds... in my hiden textbox.i have following values... robert|true|true|false|arun|true|false|true|anu|true|true|false| i want to splits in to token and insert in mysql table in following...
1
pradeepjain
by: pradeepjain | last post by:
Hii guys, I have 2 tables in which data exists of a same user like his table1:login details and table2: his further details . I have a form where in his both login and rest of details...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.