Archive for December, 2007

Table Printing Issues in Firefox

Wednesday, December 12th, 2007

Apparently there is an issue when printing tables that span more than one page in Firefox, and any other Gecko-based browser for that matter. I found one solution which linked to an A List Apart article. They attributed the issue to floated elements that run “past the bottom of a printed page.” I tried their solution, but it didn’t work for the table that was causing the problem. I then found the a second solution which seemed to fix the problem. So in the end, I added the following code to the print stylesheet:

/** Fix for tables longer than one printed page in Gecko-based browsers **/
table,td  {
    height: 100%;
}

Seeing as the second solution worked and I had other things to do, I didn’t try to figure out why the first hadn’t.

Hiding a Class if JavaScript is Disabled

Saturday, December 8th, 2007

Basically needed to be able to display a message if JavaScript was disabled, or just not available. Just give the classname “_JscptHide” to whatever needs to be hidden if JavaScript is enabled. Here’s the code:

JscptHide.js:

// Append style to created div (works in IE, Firefox)
var _JscptHide = document.createElement("div");
_JscptHide.innerHTML = "<style type='text/css'>._JscptHide{display:none;}</style>";
document.body.appendChild(_JscptHide);

// Append style element to the head (works in Safari, Firefox)
_JscptHide = document.createElement("style");
var _JscptHide_Style = document.createTextNode("._JscptHide{display:none;}");
_JscptHide.type = "text/css";
_JscptHide.appendChild(_JscptHide_Style);
document.getElementsByTagName("head")[0].appendChild(_JscptHide);

The two blocks of code were needed for cross-browser support.
The following site was inspiration for the first portion, I thought up the second part:

Geek Daily Blog

Yay…

Saturday, December 8th, 2007

It’s up.