Magic Grid is a simple, lightweight Javascript library for creating dynamic grid layouts. Magic Grid, you need to specify a container and listen for changes. Also a few other configuration options are available for convenience.
Website Demo