Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2004
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <table> --> <div>

    How could I turn this:

    <table width="648" border="1" align="center" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF">

    Into:
    <div id="hello">

    Could you show me hot to make all the crap in that table into CSS so I can put it in a sytlesheet. I'm trying to make my site entirely DIVs.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is the table used for layout purposes or do you have actual data in it? If it's layout then yes, you should replace it but if it's data then the table should remain though it would be proper to replace the table's presentational properties with CSS.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    New Coder
    Join Date
    Sep 2004
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is a layour thing. I just want to know what to put into the CSS in replace of:

    width="648" border="1" align="center" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF"

  • #4
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Code:
    width:648px;
    border: 1px solid #ffffff;
    margin: 0 0 0 0;
    padding: 0 0 0 0;

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table to CSS-P

    There's a lot more to converting a table-based layout to a CSS-P based layout then just replacing the table by a div; without any information about what's inside the table, and what the layout of your page should look like, it is rather pointless to try to cough up some style rules just based on the table attributes.

    By the way, Geoffrey: those rules only apply to the table element, not to the table cells inside it; you'll need some more for that... Width works, though!
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #6
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by ronaldb66
    By the way, Geoffrey: those rules only apply to the table element, not to the table cells inside it; you'll need some more for that... Width works, though!
    and people ask me why I don't like tables

    Here's the code from my site for a table (which is used for tabular content ):
    Code:
    table.championships {
    width:97.3333333em;
    border-right:1px dashed #000000;
    border-bottom:1px dashed #000000;
    }
    
    td.championshipsname, th.championshipsname {
    width: 17.3333333em;
    border-left:1px dashed #000000;
    border-top:1px dashed #000000;
    padding: 2px 4px 1px 4px;
    margin: 0 0 0 0;
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •