All,
I have the following selector which doesn't apply my desired background color to the td.
table.reportviewer-report td#oReportCell{
background: red; }
Here's the catch. I have a a frame where a table lives. I add the class "reportviewer-report" using jquery to the table sitting inside a frame when the frame loads using this code:
$('div#oReportDiv > table', reportFrame.document).addClass('reportviewer-report');
... and upon inspection the class is there. When the class is added, no styles are applied.
Interestingly, I take the markup + css rule to scratchpad and it works, my tds background turn red.
Btw, this also works but I want to use a stylesheet instead of hard-coding css rules using JS.
$('div#oReportDiv > table', reportFrame.document).css('background', 'red');
What's going on?
EDIT: Looks like the cause is (as indicated by the comments) that the applied stylesheet rules do not apply to nested HTML documents inside frames. Workaround is to add stylesheet dynamically using JS.