var table = document.all ? // IE document.all['tableID'] : document.getElementById ? // NN6 or other DOM compliant browser document.getElementById('tableID') : null; // no access and then you script table.rows for instance if (table) // browser supports TABLE access // use table.rows for instance color rows alternatingly for (var r = 0; r < table.rows.length; r++) if (r % 2 == 0) table.rows[r].bgColor = 'red'; else table.rows[r].bgColor = 'green';