I don’t know about asp, so maybe what I’m gonna tell you here doesn’t work very well.
In CSS we have media queries, which are basically "modes" your page is in. Example:
@media screen and (max-width: 600px){
body{
width: 100%
}
}
That is, when the device is screen (screen) and is at most 600px wide, apply 100% width on the body.
With this we also have some options that deal about printing (print
). Then you can use them as follows:
@media print{
#my-grid{
width: 1000px;
height: 600px;
top: 0;
left: 0;
}
}
That is, when you try to print by browser, the element #my-grid
will receive these new values and replace the old ones.
One way to test if your style is being applied correctly is by using Devtool.
In Chrome, open the console (F12), press ESC and scroll to the option Emulate CSS Media
. There you can select print
(printing) and check how your element looks when it will be printed.
It’s ASP.NET or Winforms?
– Jéf Bueno
is asp.net webForms, the tag was wrong, I’ll change it. Thank you.
– Mariana