Connecting Tech Pros Worldwide Forums | Help | Site Map

how use rows[] in IE8

Newbie
 
Join Date: Aug 2008
Posts: 1
#1: Aug 27 '08
Collection of tr objects (rows) in a table can;t use in IE8.
Expand|Select|Wrap|Line Numbers
  1. var oTable = document.getElementById("tbl");
  2. for (var i = 0; i < oTable.rows.length; i++)
  3. {
  4.     oTable.rows[i].style.fontWeight = "bold";
  5. }
  6.  
run with IE 7,6 or firefox ok. but run with IE8 has error rows is null.
help me. I need use rows. How ?

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,648
#2: Aug 27 '08

re: how use rows[] in IE8


if this is not triggered by an event you could even use simple CSS
Expand|Select|Wrap|Line Numbers
  1. #tbl {
  2.   font-weight: bold; }
  3. /* tr and td will inherit that value */
Reply