Reputation: 12621
I am using GWT/GXT.
i have used GWT's grid and each row is highighted in background color using CSS. but applied css is not printed in printed page. how can i print with css?
I am calling Print functionality as below:
Print.it("<link rel='StyleSheet' type='text/css' media='paper' href='mainApplication.css'>", DOM.getElementById("myId"));
in mainApplication.css i placed style as below:
@media print {
print_background {
background-color: #EBECE4 !important;
}
}
is my CSS style correct? Please help me.
in the code :
i created a horizontal panel and added GWT grid to it as below.
HorizontalPanel recordsPanel = new HorizontalPanel();
//GWT grid is created and the same is added to recordsPanel
recordsPanel .add(grid).
i applied css style for grid rows as below:
recordsGrid.getRowFormatter().addStyleName(i, "print_results_background");
Now i want to print the records with css style.
Thanks!
Upvotes: 0
Views: 1499
Reputation: 16263
paper
is not a valid value for the media
attribute. Correct your link
tag as follows:
<link rel='stylesheet' type='text/css' media='print' href='mainApplication.css' />
Ignoring other syntactic mistakes as mentioned by other posters, please refer to RAS's comment on the question also (regarding the differing class name).
Upvotes: 1
Reputation: 2449
I think you are missing in the css to specify if print_background its an id # or a class .
Upvotes: 0
Reputation: 3276
You CSS style isn't correct for a trivial issue: lack of dot (.) before print_background class. Correct code is:
@media print {
.print_background {
background-color: #EBECE4 !important;
}
}
Upvotes: 1