Today, I tried to create a CSS file so readers of my stories can get a nice looking printout. Or so I thought.
The cast: Opera 10, Chrome 7, Firefox 4, Konqueror.
The task: Print plain text, two column, 2.5cm left margin.
Opera has one of the best print drivers for HTML. No other browser comes even close. But no support for
Webkit does support
column-count but not the official CSS3 style. You need a special attribute called
What’s way less cool is the fact that the printer driver doesn’t support it. You can see it, but you can’t get it, baby.
-moz-column-count, you get two columns which make it into the printed page … but what is that huge left margin doing there? That looks like I get only 70% of the page for my text! There are three menus where I can “Setup page” but none of the dialogs behind them allows me to modify the huge print margins! What gives?
You’re kidding, right?
With the Webkit module, the print output looks mostly the same as in Chrome. With the KHTML module, I can’t even get two-column text.
The WWW was invented 1991. That was twenty years ago. Two decades. And web browsers still can’t get something right that bored TeX in 1984.
Well, the reason might be that the web has a much different purpose than TeX. First of all, multi-column text in the scrolling environment of the web makes little sense. I hate reading papers which are usually two-column as well (at least most ACM publications) on screen for exactly that purpose. You have to scroll down, scroll up again, down once more. Not nice. Of course, for printing it might be nice, but pressure there is likely not as much as with fancier stuff like rounded corners or shadows.
Then printing web pages is something likely very little users to. You may ask the IE team or Mozilla for numbers, both should have them. But I suspect most people usually don’t print their web pages.
As for CSS, it’s not as old as the web, dating back only 13 years ago. Also CSS 1 back then was not even a powerful layout language. In fact, it fails to be currently as well, which is part of the reason that CSS 3 has several layout modules in development.
Prince might be able to properly render multiple columns with your desired margin as it specifically targets printing and not primarily screen display.
Well, sure, I didn’t expect output that comes even close to TeX. But if a browser supports displaying multi column text, it should be able to print it as well, no?
I’m not even going into things like headers/footers that are cut off by the print margin, or irregular kerning or weird fonts that don’t look one bit like what you can see on the screen…