WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Double list with text in page (7 posts)

  1. simenfs
    Member
    Posted 8 years ago #

    Hi. What I'm trying to do is just to have my Page show a member list, or just text in 2 columns. Like this:

    List One___________List Two
    Name_______________Name
    Name_______________Name
    Name_______________Name
    Name_______________Name
    Name_______________Name
    Name_______________Name
    Name_______________Name

    How can I do that? I guess it involves some Css, but I'm not good at it so need a push in the right direction.

    Thanks

    EDIT: The underlines should be just a white space, but it didn't work in this forum to just add white space. :/

  2. mores
    Member
    Posted 8 years ago #

    do you want it dynamic, or manually entered text?

    if manually, use a table!

    uhm, that answer seems way too easy to be correct, so i'm guessing you want some sort of dynamically generated list, but i have no idea how to do that.

    but i could use something like that too, i think :)

  3. simenfs
    Member
    Posted 8 years ago #

    I guess I could do with tables. But just thought it must be some way to do it with CSS ? And the names/text will be entered manually.

    I'll test it out with tables.

  4. vnbPaul
    Member
    Posted 8 years ago #

    For now, a table will be far easier if you're unfamiliar with CSS. On the other hand, getting familiar with CSS will eventially make anything you do regarding themes (or just web pages) a lot easier.

    Basicaly what you're trying to do can be done with divs. You set up one as a container and in it you put 2 more, one for each column and you float one of these left and the other one right. So something like:

    <div class=container>
    <div class="leftColumn">
    ... use an unordered list here for column 1's items ...
    </div>
    <div class="rightColumn">
    ... use an unordered list here for column 2's items ...
    </div>
    </div>

    Then you'd add the styles for the divs (and ul lists) to style.css in your theme (probably). You can give the container div a width of 100% and the two column divs widths of 48% and remember to float them in opposite directions (col 1 left, col2 right).

    For help styling the unordered lists, see if this helps.

  5. moshu
    Member
    Posted 8 years ago #

    Isn't this exactly the kind of data that CSS advocates say "the tables should be used for tabular data"... :) ?
    So, why the sweating about css in this case?

  6. vnbPaul
    Member
    Posted 8 years ago #

    A "table" would imply that the columns and rows are providing metadata -- e.g., this is a column of new members and this one's of old members. What the OP is looking for is a way to format a list -- the columns have no meaning in terms of the data, they're just being used to format it. This is exactly what CSS advocates say tables are not for.

  7. simenfs
    Member
    Posted 8 years ago #

    Thanks people. Will try the code vnbPaul now :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags