Hi All,
I am facing CPU utilization issue while iterating through HTML table rows. I am generating an HTML table dynamically using javascript
which contains atleast 500 rows. After the creation of table, the table cells are assigned with some values from a JSON object. The sample code for assigning cells values is shown below.

for(var i = 0;i<tbl.rows.length;i++){
    tbl.rows[i].cells[0] = JSON.AAAA;
    tbl.rows[i].cells[1] = JSON.BBBB;
   ...
   ...
   tbl.rows[i].cells[12] = JSON.MMMM;
}

The execution of the above loop takes lots of cpu cycle. It takes the cpu upto 99.
Please help me to reduce the cpu utlization.

Thanks

Maybe posting the *exact* code which is causing problems in your case would help in faster resolution of the issue at hand. And please use CODE tags when posting code to increase your chances of getting a reply since reading unindented code is a pain in the neck. Read the forum announcements to learn more about CODE tags.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.