4

I have a right column on my page that has varying heights, set as height: auto;

I also have a left content section, that I want to mimic the height of my right column.

How can I do this using css, jquery, or some other code?

sir_thursday
  • 5,270
  • 12
  • 64
  • 118
  • 1
    I think you're after [this sort of thing](http://stackoverflow.com/questions/1056212/how-do-i-achieve-equal-height-divs-with-html-css). – Alconja Aug 23 '11 at 03:15
  • Cant you just set them to be within the same html table row? – Quincy Aug 23 '11 at 03:16
  • 1
    My apologies, I was answering the question that I saw in the title. You might want to rephrase it a bit more specifically. – Matt Ball Aug 23 '11 at 03:18

1 Answers1

6
$(document).ready(function() {
    var x = $('#primary').height();
    $('#sidebar').css('height', x);
});

This jQuery snippet will take the height of #primary and apply it to #sidebar, syncing the height of both elements.

http://jsfiddle.net/pUXCE/4/ <-- working example.

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
GoGoGarrett
  • 613
  • 4
  • 16
  • 1
    It works, there was just a type-o in the word "function". Try it again with the proper spelling, should work as intended. – GoGoGarrett Aug 23 '11 at 03:21