Friday, May 14, 2010

Repeating and aligning elements using jQuery and CSS

Today I had a need to create a dynamic list of checkboxes, and I wanted them all aligned properly, so the results would look something like this:


The layout was simple with CSS, then I added some jQuery to simulate getting the checkbox items dynamically.


That example produces a list that adjusts appropriately when resized:

image image