Grow your CSS skills. Land your dream job.

Creating tables with DIV

  • # October 21, 2008 at 2:19 pm

    Ive tried every combination of div tags, css, etc that I know of, and I still cannot get it to do what I want.

    Heres the deal.. Ive got a page. Its a table done 20%,60%,20%. In the right 20%, Ive got another table. This table is set up as the following:

    Code:
    Server Status:

    The contents of that div tag are inserted using AjaxUpdate. Its set to refresh every 15 seconds. What Im doing could very easily be done with tables, but the browser will not render the table if its inserted after the page is created, it must be done before hand. This is not an option. It leaves me with using css and div tags to create the list.

    What Im looking for, is a name aligned to the left of the table, a status (simple UP/DN, may be images later.. would use X and a checkmark, but IE *puke* will not render the checkmark, and that craptastic browser is forced on people here at work.) aligned to the right, and multiple rows of this. Each row separated by an <hr> maybe.

    Code:
    NameStatus


    NameStatus


    NameStatus


    NameStatus

    If Im unclear or left anything out, let me know.. a bit distracted here at work.

    Thanks.

    # October 21, 2008 at 11:40 pm

    I’m not sure if I follow, but… why don’t you put the section in a div with text-align to the right, then make a class for the name and float it left.

    CSS

    Code:
    div#statusBox {width: 20%; float: right; text-align:right;
    div#statusBox .name {float: left;}

    HTML

    Code:
    Name: Status:

    Name will be on the left edge, status on the right.

    # October 22, 2008 at 12:54 pm

    Thank you, that worked.

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

You must be logged in to reply to this topic.

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