Can we put jQuery to use to create columns of equal height? If yes, how?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update from 2022
JavaScript
jQuery is a bit overkill for something like this; you could use vanilla JavaScript:
Or (preferably) CSS
In reality, JavaScript probably shouldn’t be used at all. Modern browsers have supported Flexbox for quite some time, which is capable of keeping laterally-placed elements equal in height:
Assuming the following (taken from original demo below):
Flexbox creates columns of equal-height (based on the tallest) with the following:
Original Answer
Cycle through each column, and find the tallest. Then set all to that height.
Online Demo: http://jsbin.com/afupe/2/edit