Max
Max

Reputation: 8045

how to set the table's row background color in IE

i used

mycurrent_row.setAttribute("bgcolor", "#EEF4EA");

it worked for both firefox and chrome.but no color was set in ie

i use

mycurrent_row.setAttribute("bgcolor", "#EEF4EA");
mycurrent_row.bgcolor = "#EEF4EA";

it neither work.

How can i set the row's color in IE?

Upvotes: 2

Views: 8500

Answers (2)

Guffa
Guffa

Reputation: 700910

The attribute is named bgColor, not bgcolor, but you should rather use the backgroundColor CSS property for styling instead of the deprecated HTML attribute bgColor:

mycurrent_row.style.backgroundColor = "#EEF4EA";

Upvotes: 4

Billybonks
Billybonks

Reputation: 1568

You can set the style inline

mycurrent_row.setAttribute("style", "background:#EEF4EA");

Upvotes: 3

Related Questions