473,378 Members | 1,617 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,378 software developers and data experts.

insertRow() problem

I'm using this code:

var tbl = document.getElementById('participants');
var newRow = tbl.insertRow(tbl.rows.length);

(obviously) to add a new row to a table. The intention is that the new
row be at the bottom of the table. This works perfectly in IE, FF,
Netscape and Opera. But in Safari, the new row is inserted at the TOP
of the table.

This is especially a problem because it puts the new row on top of the
header row - so the header ends up at the bottom of the table.

So, my questions are:

1) Is there another way to add rows to the table that will put them in
the correct place, and is cross-browser compatible (and preferably of
comparable simplicity)?

and,

2) Have I totally missed something basic? Specifically, is there a way
to separate the header row from the other rows? If this inserted the
new row at the top of the DATA rows, but below the header, I would be
happy.

TIA...

Nov 23 '05 #1
1 1746
>2) Have I totally missed something basic? Specifically, is there a way
to separate the header row from the other rows? If this inserted the
new row at the top of the DATA rows, but below the header, I would be
happy.


DOH.

<thead> & <tbody>

Nov 23 '05 #2

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

Similar topics

3
by: Marco Alting | last post by:
Hi I'm currently developing a form with a dynamic table. initially the table is populated with data and at the end of each row there are two buttons: addLevel and addItem. Each button creates a...
3
by: milkyway | last post by:
Hello, I am working with an old Java Script code and have found the following but after putting in alerts I have found that insertRow doesn't work. What is the problem? TIA function...
1
by: putty | last post by:
I found a few posts of people asking about insertCell()/insertRow() not working in IE6 SP2, and a few others about getting "null is null or not an object" errors, but no one posted a solution...
2
by: Howard Jess | last post by:
CLJ -- I've searched the newsgroup and FAQ for info on insertRow(), but didn't see this reported. It seems that Internet Explorer doesn't respond correctly to either insertRow() or...
8
by: Hal Burgiss | last post by:
Hi, and help for a novice trying to get some data dynamically into tables. I did a small proof of concept page which works fine in IE6 and Mozilla. Using code such as this: tbody =...
1
by: Christopher Berg | last post by:
hi. is there a way to add an id='...' tag to a table row when using the javascript insertRow() ? i wish to be able to manipulate this row later if i need to using that identifier (eg to toggle...
1
by: raju78.k | last post by:
Hi, I have a problem with FireFox. I have written a function to Add rows without submiting the form. This function works fine in IE, but not in FireFox. The function is : function...
1
by: MoProtein | last post by:
I created a row using insertRow: r = tbl.insertRow(); and I want to be able to add an onclick handle to that row. Does any one know how to do this? BTW I've tried
3
by: DL | last post by:
Here's the thing, I have this HTML Table, that has multile rows already, each has an ID, one of them at the bottom section has id of "SaveData", new TRs are dynamically created upon user...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.