April 29, 2013

Printing Wide HTML Tables

I built a report using HTML table that had more than two dozen columns. In fact, it was a matrix report where the number of rows and columns could grow indefinitely. The report looked perfect on the screen. However, upon printing, the browsers would print only the left portion of the table while the portion which does not fit on the page horizontally is discarded.

I was not able to find a solution so I made a half-hearted attempt at this. My "solution":

  • Create a fixed width div with hidden overflow
  • Place a copy of the table inside this div
  • Scroll the desired portion of the table into view using CSS positioning
  • Repeat as many times necessary

April 11, 2013

301 Redirect Your Old Blogger Blog to New Address

Back in February I decided to change the address of my blog from 911-need-code-help.blogspot.com to salman-w.blogspot.com. Changing the blog address is straightforward; however, I wanted the following to happen after the change:

  • Backlinks to the old blog should continue to work
  • Visitors attempting to access the old blog should be redirected to the new blog automatically
  • Search engine ranking for the old blog should be transferred to the new blog

In short, I needed to redirect old URLs to new ones. Given that Blogger does not have an option to redirect URLs to another blog and mod-rewrite/server-side scripting is not available either; my only option was to use zero second meta refresh tag which is (claimed to be) treated as a 301/permanent redirect by Google. So, here is what I did:

NOTE THAT THIS ARTICLE IS ABOUT MOVING FROM ONE BLOGSPOT.COM ADDRESS TO ANOTHER. If you are moving from Blogspot hosting to custom domain, you (probably) don't have to do anything special. If you are moving from one custom domain to another, ask your domain name provider to setup a 301 redirect on the old domain.