Tableless CSS

Discussion in 'HTML & Website Design' started by anisbd, Dec 3, 2008.

  1. #1
    Hey all,

    I have some pages where used table. i want to replace table with div/ul using CSS.

    Sample:
    
    DELETE CODE
    
    HTML:

    Please help me
     
    anisbd, Dec 3, 2008 IP
  2. Sensei.Design

    Sensei.Design Prominent Member

    Messages:
    3,847
    Likes Received:
    162
    Best Answers:
    0
    Trophy Points:
    310
    Digital Goods:
    1
    #2
    Sensei.Design, Dec 3, 2008 IP
  3. cheapez

    cheapez Active Member

    Messages:
    1,123
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    78
    #3
    Here is the idea

    style important:
    Set div width, height, and add border to div, same for lists if needed. you can display them as blocks.
    #table {margin: 0; padding: 0; width: 200px; height: 100px;}
    #table ul {display: inline;}
    #table ul li {list-style: none;}

    ------------------
    <div id="table">
    <ul>
    <li>TD left</li>
    <li>TD right</li>
    </ul>
    <ul>
    <li>TD left</li>
    <li>TD right</li>
    </ul>
    <ul>
    <li>TD left</li>
    <li>TD right</li>
    </ul>
    <ul>
    <li>TD left</li>
    <li>TD right</li>
    </ul>
    </div>
    ..........
     
    cheapez, Dec 3, 2008 IP
  4. anisbd

    anisbd Active Member

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    83
    #4
    Thanks for replay ....

    but i have 40+ pages.. i want to create common CSS for All pages.
    NB: tables td height are different.
     
    anisbd, Dec 3, 2008 IP
  5. Sensei.Design

    Sensei.Design Prominent Member

    Messages:
    3,847
    Likes Received:
    162
    Best Answers:
    0
    Trophy Points:
    310
    Digital Goods:
    1
    #5
    well thats possible just create one stylesheet and link it to each page and replace the tabless with div's
     
    Sensei.Design, Dec 3, 2008 IP
  6. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It is always called "tableless layout" rather than "tableless css" .
    Tableless layout is very flexible, reusable and for common purpose .
    You can learn it by yourself, it is easy .
     
    justinlorder, Dec 3, 2008 IP
  7. anisbd

    anisbd Active Member

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    83
    #7
    OK thanks all
     
    anisbd, Dec 3, 2008 IP
  8. fragin_bastich

    fragin_bastich Guest

    Messages:
    65
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ummm...Just a thought but...

    Using tables to control layout is an html hack...tables are meant for tabular data, not layout...agree?

    The point of dispensing with tables in your layout in favor a proper css is to conform to web standards, for the purpose of better more semantic, less bloated, easier to control code...agree?

    So Why would you use list elements to control layout? What is the difference between using all of that bloated code with all of those list as layout tools, that is really the same as just saving yourself the trouble and keeping the tables.

    List elements are meant to identify LISTED ITEMS, not layout. Use the proper DIV elements to control DIVISIONS

    <div class="left">
    TD LEFT
    </div>

    <div class="right">
    TD RIGHT
    </div>

    <div class="left">
    TD LEFT
    </div>

    <div class="right">
    TD RIGHT
    </div>

    etc


    etc

    If you are using tables to display tubular data, than tables are GOOD...for page layout BAD
    If you are using list to display listed data GOOD...page layout BAD
    If you are using h1, h2, h3, h4, h5, h6 to indicate proper hierarchy GOOD... for display purposes only (font, weight, etc) BAD

    list for list, tables for tables, and divs for divs

    Not trying to be a hardass, really I'm just trying to help...I highly recommend heading over to sitepoint and getting a hardcopy of:
    "html utopia: designing without tables using css"... straightforward, beginner to advanced, and and excellent reference to keep on your desk and mark up for a LONG time to come.
     
    fragin_bastich, Dec 3, 2008 IP
  9. icecubedesigns

    icecubedesigns Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    if you would like us to do that for you, we can complete that with perfection
     
    icecubedesigns, Dec 4, 2008 IP