Filed under: Text, Productivity, Google, web 2.0

Add page numbers and other information to Google Documents

As Google Docs slowly begins to take form as a legitimate office replacement, there are still a few glaring feature absences. One of those is the inability to add custom-formatted page numbers or dates to your documents.

If you don't mind rolling up your sleeves and getting your hands a little dirty, Google Operating System tells us how to add page numbers and other information to your document's header or footer. This involves a little HTML editing, so consider yourself warned.

Note: If you simply want page numbers added to your Google Doc, and you don't need to customize them by adding color, size, or scheme, then you're better off exporting the document as a PDF and selecting the bullet that adds page numbers to your document. In other words, the following method is useful only if you want more customization than Google Docs by default provides.

In order to add a header that displays, for example, "Page (current page number) of (total number of pages)", open your Google Doc, click on "Edit HTML" (right next to the Revisions tab), and add this code at the very beginning of the code:

<div style="text-align: right;" class="google_header">Page <span class="google_pagenumber">1</span> of <span class="google_pagecount">1</span></div>

To add the same information to the footer, add this code to the bottom of the document:

<div style="text-align: right;" class="google_footer" id="google_footer">Page <span class="google_pagenumber">1</span> of <span class="google_pagecount">1</span></div>

Now that the code is in, you can customize it any way you desire.