views:

22

answers:

2

Hi,

I have HTML page of few tables created by ASP.NET and when I do the "Page Setup" option before printing the paper size is already selected as "Letter" and I want that option to be in "A4". I changed the size of the table but its not working.

Is there any page setup information I can put in HTML so that "Page Setup" option can take it from there.

Please help.

Thanks Anto

A: 

You could give it a try with CSS, using the @page rule. Mind that this is valid for CSS 2.0 and CSS 3.0 but not for CSS 2.1:

@page { size: A4 };

I'm not sure if this will change your default selected paper size though.

Anax
Hi Anax, I tried the "Page" tag in CSS but it didn't work. Lots of Google results also say the same but its not working.
Antoops
A: 

You have to use media type in CSS. This way you can specify a different set of styles for print and screen medias. Here is an article about printer friendly pages. You can also read about media types in the W3C learning section.

You cannot change anything in the Print window from the HTML. You can just specify another CSS file for print media to make your page look better when you print it (like remove buttons, remove any content which is useless on a sheet of paper, change sizes, change fonts, etc.)

Hope this helps.

Pavel Nikolov