February 18, 2009

New Website Done

Just finished the website for Harvard College Consulting Group (http://www.hcs.harvard.edu/hccg/).

Pretty straightforward website, simple CSS-based div design, with PHP calling the header, top menu, left menu, and footer. Google analytics integrated in the footer, and both the CSS and XHTML validated with W3C the first try!

Most importantly, it should be amazingly easy to edit for future classes of Harvard consultants! Just have to modify the page in question, and there’s a clearly visible div called “content.” Everything ugly is hidden in the PHP headers and footer. Yay for bloat-free, non-CMS websites!

editicon Post/View Comments

feedicon Subscribe - RSS Feed



October 6, 2008

Using divs vs tables

Filed under: CodingTags: , — darrenhe @ 2:25 AM

I’ve been working on some websites lately, and I’ve been pleasantly surprised by how efficient <div /> is compared to <table />. In the example below, my home page condensed from over 80 lines of code to a mere 29. Of course, this was aided by better use of CSS, but I feel that it was easier to use CSS once I had divs in. There are some things that table do better though, and for me it is the vertical-text align. Trying to center align some text vertically involves creating multiple nested divs, alignment of the first inner div to 50% of the outer div, and then alignment of the second inner div to go up 50% of the text! Nonetheless, it’s a sacrifice worth making. See below for before and after screen shots.

Tables

Before: Tables, 80+ lines of code

Divs

After: divs, 29 lines of code

In theory, I suppose I could discount the meta tags to get an even lower line count.

editicon Post/View Comments

feedicon Subscribe - RSS Feed