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

DHTML Cells In Large Table... Takes FOREVER!

Can anyone help me on this one?

I have a giant (couple thousand rows) HTML table.

Im trying to modify some of the cells innerHTML and/or innerText, but
it is taking a VERY long time to do so.

I believe that the problem is not with executing the code, but rather
with the browser reparsing the page, or the table, or something.

Basically, if I get a reference to a TD element in a variable called
MyCell, then I have this code.

alert("about the update cell");
MyCell.innerHTML = "hello";
alert("finished");

When I do this, I hear the "Bing" from the 2nd alert box very fast,
almost right away when I click OK to the "about to update cell" alert
box, but the actual alert box saying "finished" doesn't show up for
another 5 seconds or so. During these 5 seconds, my browser is
locked, and the change I made in javascript does not show.

I tried using: style="TABLE-LAYOUT:fixed;" in my table, this helped
load the table faster (it will start showing rows before it has
finished loading the whole table), but it did nothing for my DHTML
times...
Can some guru out there help me with this one? Is there anything else
I can do here to help with this problem?
Jul 20 '05 #1
1 4676
DU
Steve van Dongen wrote:
On 23 Jul 2003 21:00:32 -0700, cm**@walshgroup.com (Chris) wrote:

Can anyone help me on this one?

I have a giant (couple thousand rows) HTML table.

Im trying to modify some of the cells innerHTML and/or innerText, but
it is taking a VERY long time to do so.

I believe that the problem is not with executing the code, but rather
with the browser reparsing the page, or the table, or something.

Basically, if I get a reference to a TD element in a variable called
MyCell, then I have this code.

alert("about the update cell");
MyCell.innerHTML = "hello";
alert("finished");

When I do this, I hear the "Bing" from the 2nd alert box very fast,
almost right away when I click OK to the "about to update cell" alert
box, but the actual alert box saying "finished" doesn't show up for
another 5 seconds or so. During these 5 seconds, my browser is
locked, and the change I made in javascript does not show.

I tried using: style="TABLE-LAYOUT:fixed;" in my table, this helped
load the table faster (it will start showing rows before it has
finished loading the whole table), but it did nothing for my DHTML
times...

Can some guru out there help me with this one? Is there anything else
I can do here to help with this problem?

If all you are doing is changing simple text, use innerText instead of
innerHTML.

Regards,
Steve


I made an interactive demo page exactly about this issue. Performance
gain of 300% to 2000% depending on browsers, cpu, RAM.

innerHTML versus nodeValue performance comparison:
http://www10.brinkster.com/doctorunc...NodeValue.html

"By now, almost everyone knows that using element.innerHTML is slow,
slow, slow. To see just how slow it was, I made a final test page that
used innerHTML instead of innerText to insert "Text" into the cell. This
literally crushed performance. Total time went to 3375 m/s, more than 80
percent worse than the previous test. This one change brought the total
baseline comparison to -45 percent. Clearly, innerHTML is pretty expensive."

http://msdn.microsoft.com/library/de...ude100499.asp?
frame=true&hidetoc=true

http://msdn.microsoft.com/library/en...dude100499.asp

nodeValue is W3C web standards compliant while innerText is not.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #2

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

Similar topics

6
by: Matt Liverance | last post by:
I REALLY dont want to switch to oracle :( but I cant get these tables working any faster. I've got 2 dedicated servers, each with a slave, all run 32gig 15k rpm raid 5 on u320 perc raid...
11
by: Thomas | last post by:
I am trying to produce a table dynamically when the user presses "add to queue". It works great in Mozilla, but it is formatted incorrectly in IE. What I meant by the checkbox was that it should be...
1
by: Elf M. Sternberg | last post by:
I have a table of two columns and four rows. The top two rows are occupied by two cells each; the bottom two rows are set ROWSPAN=2. (Yes, I'm using this for layout. It's a legacy app. I'm...
9
by: Paul W | last post by:
I'm using a Table webcontrol to display a 'grid' to the user. Various cells should be 'clickable' by the user (to run javascript). How can I make this happen? (currently I use the background cell...
4
by: David Tilman | last post by:
I've created a web application using ASP .NET that creates tables similar to Gantt charts. There are 5 tables will 180 cells each, so there are about 900 cells on the web page. I had javascript in...
2
by: Questman | last post by:
Good afternoon, Does anyone have any code that implements, or approaches implementing, a cross-browser DHTML/JS solution to provide an Excel-like Grid on a web page - I'm trying to convert an...
4
by: Steve | last post by:
hi all, i'm using DHTML to generate a dynamic table with adding removing and sorting rows the thing is after a row has been added at a position that i specify, if i try to delete it i get this...
3
by: patl | last post by:
Hi all, I am trying to write a terminal emulator using Javascript + AJAX and I need to create an 80x25 table (each cell contains 1 character) in which I can update the contents of each cell...
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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.