Grow your CSS skills. Land your dream job.

using jquery to make text into 2 equal columns HELP!!

  • # January 29, 2010 at 10:35 pm

    I want text in 2 columns, like a newspaper but without having to create divs and trying to balance the sizes. How could I easily use jquery to move the text into 2 columns?

    # January 31, 2010 at 3:37 pm

    I’m doing something like this on my site

    Code:
    function equalHeight(group) {
    var tallest = 0;
    group.each(function() {
    var thisHeight = $(this).height();
    if(thisHeight > tallest) {
    tallest = thisHeight;
    }
    });
    group.height(tallest);
    }

    $(document).ready(function() {
    equalHeight($(“.classname”));
    });

    Where ".classname" is a common class among the divs you want to equalize

    # January 31, 2010 at 4:55 pm

    Not really what I want.

    I want to just have text, no divs, and use jquery to make all the text into two equal columns. That way when I add more text later, I don’t have to move text from one div to another.

    # February 10, 2010 at 10:52 pm

    Here’s what you want, but it’s css3. I’m not aware of any way to do this with jQuery.

    http://www.quirksmode.org/css/multicolumn.html

    # February 11, 2010 at 2:06 am

    Yes. That is exactly what I want. Unfortunately it’s not cross browser compliant. Anyone know of a way to get it to work in IE too?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".