You can do it, just not in IE
A lot of my answers to both email and clients used to begin: You can it, but only do it in IE
. Or I'd assume they took that for granted and instead informed them it wouldn't work in Netscape. Now I find myself saying more and more often: You can do it in Firefox/Opera/Netsape†
. For example, last week I got asked two questions about printing.
- 1. Is it possible to prevent page breaks from being inserted in the middle of a paragraph?
-
Yes you can. Well, as long as the paragraph is smaller than a page. Otherwise, how can it do anything but? Here's how:
p { page-break-inside:avoid; }
Simple isn't it!? The page-break-inside property was added in CSS2. However, the only browser that I've found to support it is Opera 7.5+.
- 2. Can I add a 3.5" margin to the top of the first printed page and 1.5" to the top of all others?
-
Yes you can. In theory. In practice the following CSS2 only seems to works in Opera 7.5+.
@page{ margin-top:1in; } @page:first{ margin-top:3.5in; }
It uses margin settings of the page-box to govern the gap at the top of each page.
If you've got Opera (preferably the v8 beta) you can see both solutions in effect on this demo page. Notice I left the first letter of each paragraph in bold when printed. This should help see whether there's a page-break in any of them.
Now, I know Opera is a minority browser that is even less likely than Firefox to take over from IE any time soon, but, that's not the point. At least Opera is supporting this stuff. What's IE doing? Sitting on it ass! It's frustrating to think the solutions to problems are being dealt with and knowing there's slim chance we'll get to use them. Maybe Firefox will catch up sooner or later. Will IE ever? Don't hold your breath.
As developers we can help make a difference though. If enough of us tell enough IT Managers that things can be done, but not in IE, it can only be a matter of time before they take notice.
OT: I wrote this entry using a slightly twisted application of a Definition List. The first time I've ever used one ;o)
† Delete where applicable.
First time ever? Oddly, I'm not so very surprised. I've been using definitions since forever (HTML 1 for Lynx) -- for (and here's a use you almost never see) glossaries. That was one of the first things I did in Domino, too -- after I found out that you could do your own HTML in views from some rinky-dink website with a Flash fly-away logo (can't recall the name, offhand). That first one used the user defaults (no CSS), and I got a lot of questions about how I formatted things from my colleagues.
I was "reminded" they exist reading a book about designing with standards. It suggest using them for form layout and I'll probably use the technique on this site before long...
Glad to see you're still reading Stan. Not seen you round here for a while.
Flash? Here? Nah. You must have imagined it.
Jake-
Thanks for bringing my plight to light. To solve my page-breaking issue, we had no choice but to add a button to export the view data to Microsoft Word using a LotusScript agent, and use Word's "KeepTogether" paragraph format in the script to prevent a page break from splitting the paragraphs between pages.
I have a few friends that work for Microsoft, and I'll be seeing them in a few weeks. I'll ask them if they know if these issues will be addressed in IE7.
-Brandon
Funny, this title reflects my most recent problem, but not the article.
I've discovered that Mac IE has never had support for personal SSL certificates (x509) so now the odd user who still uses Mac IE cannot get to our intranet we recently changed to support personal certs...
MSKB: {Link}
Grrrrrr.....
"What's IE doing? Sitting on it ass!"
Microsoft must be in deep trouble if they're using donkeys as office furniture!
The issue of browser compliance with standards is so depressing - frankly, it sounds like IE7 will fix some of MS's problems (eg. security) but none of ours (eg. CSS).
I prefer the mental image of Bill G riding a braying donkey (ie. ass)...
Mozilla/FireFox don't appear to support these either :/