Dave Dash

Equal height columns with jQuery

Tagged: programming, css, css, javascript, equal-columns, columns, equal, layout, jQuery

[tags]css, jQuery, layout, javascript, equal, columns, equal columns[/tags]

I've seen a few examples of how to equalize column heights using javascript, and none of them seem appealing:

So I wrote my own:

$("#col1, #col2").equalizeCols();

will equalize the columns as expected

$("#col1, #col2").equalizeCols("p,p");

will equalize the columns and add the extra space after the p tag in #col1 or #col2 (whichever is shorter).

Here's our function:

This requires jQuery of course, and it hasn't been tested much.