zackgrossbart.com
Submitted by: Chris Coyier

Dynamic Grid Layout In JavaScript

In this simple example we line up four items in a two by two grid. Here the items are simple text, but they are just div tags and you can put whatever content you want into them. The grid is aligned with a simple call to the alignGrid function. It looks like this:

direct link