Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

CSS V tables for formating text ?

Options
  • 29-09-2007 2:19pm
    #1
    Closed Accounts Posts: 216 ✭✭


    To create a 3 paragraphs on a page I could create a table to format the paragraphs , or I could create one div tag for each paragraph and then format the div tag using CSS?

    Is one option better than the other (just preference .etc) or am I missing other options ? - thanks


Comments

  • Registered Users Posts: 3,594 ✭✭✭forbairt


    delanest wrote:
    To create a 3 paragraphs on a page I could create a table to format the paragraphs , or I could create one div tag for each paragraph and then format the div tag using CSS?

    Is one option better than the other (just preference .etc) or am I missing other options ? - thanks

    Those are pretty much your options ...

    Why do it using DIV's when its so much easier to use a table ... well its because we as webmasters want to make it more tricky for the average joe bloggs to break into webdesign .. :P ... joke ...

    The real reason is a question of separating your design from your content ... but the table is doing the same thing you say .. and yes it is to a certain extent however what its doing is fixing the positioning of your content into a 3 column layout ... that you can't alter without altering your table ... this starts to get a lot more complicated as you decide to layout something within one of your columns with another table .. and you can start to find you're using nested tables allover the place for layout

    However with div's and css ... I can position the right paragraph absolutely ... to the top of the page if I want ... I've not changed my html file at all only the CSS ...

    I can decide I want to give one of my columns ... a black background and white text ... I can easily add padding .. and have my lists / links contained within it formatted differently to the other columsn adn s o on ...

    While its still possible with the table ... you'll find in the long run its more work.

    You should always try to separate your content and your layout when possible

    hope thats some help ..


  • Registered Users Posts: 145 ✭✭RedCardinal


    delanest wrote:
    To create a 3 paragraphs on a page I could create a table to format the paragraphs , or I could create one div tag for each paragraph and then format the div tag using CSS?

    Is one option better than the other (just preference .etc) or am I missing other options ? - thanks
    Not sure if columns come into this, but the best way to do this is also the simplest:
    <p>paragraph1</p>
    <p>paragraph2</p>
    <p>paragraph3</p>
    
    The <p> element is for paragraphs.
    Compare that to doing the same thing in a table :)


  • Registered Users Posts: 3,594 ✭✭✭forbairt


    The <p> element is for paragraphs.
    Compare that to doing the same thing in a table :)

    I completely misread what he was after :D ... there goes 3 minutes of my life I'll never get back :D


Advertisement