Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7

Thread: Tables and Divs

  1. #1
    Member drews's Avatar
    Join Date
    Nov 2002
    Location
    St. Petersburg, Florida
    Posts
    63
    Member #
    341
    I know that when one wants to build a standards compliant website, they should use CSS and DIVs as opposed to TABLES. But my basic understanding is that DIVs go on their own line. So how could you place two DIVs right next to each other? Or is this accomplished using DIVs and SPANs?

    Thanks.
    -drews
    -White Fiber Hosting - Coming Soon!

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Just look at the source for any sites at www.cssvault.com, or the examples at www.bluerobot.com or at www.alistapart.com

    For example, if you set one div to float:left; it will "float" to the left of the next div. You just have to understand how CSS positioning and layout works, my example is to learn by experience.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  4. #3
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    The basic answer is that div's default display property is block, which means it sits on its own line, like a whole paragraph does. There are a few different ways to make divs sit next to each other: make display: inline, float it (as outlined above), or set position: absolute and give it left, right, top or bottom properties.
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)

  5. #4
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    what alot of people do not know is that you can float multiple objects to the same side.. This will enable you to put divs next right next to eachother. Look at the attatched file for an example. All the blue squares are floated to the right, the yellow, to the left. View the source for how it works.


  6. #5
    Senior Member ceetee's Avatar
    Join Date
    Jul 2003
    Posts
    117
    Member #
    2035
    *I know that when one wants to build a standards compliant website, they should use CSS and DIVs as opposed to TABLES.*

    Your knowledge is wrong. If your site validates, it complies with standards. Everything else is just personal opinion.

    The design, whatever you interpret that to be, should drive the code. Not the other way round.

  7. #6
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    It validates, however it is not standards-compliant.

    There is a lot more to standards than just validation, it is nested in a root of intended uses for tags and usability native to the browser.

    Take for example if you were to highlight some code on your site. You have a few options here, you could put the code in:
    Code:
    <p class="code">my code goes here</p>
    or, alternatively
    Code:
    <span class="code">my code goes here</p>
    but, take for instance this:
    Code:
    <code>my code goes here</code>
    All of these examples validate, but one follows the standards and guidelines set forth by the W3C, hence standards-complaint. Kind of the idea that the method is more important than the answer.

    It is personal opinion, however, I will give you that. The difference is that it's the W3C's personal opinion, so if you're going to follow someone's guidelines, might as well be theirs.

    And your last statement has nothing to do with anything in this argument... I don't see the point whatsoever. There is absolutely no situation I've found in which using tables to lay out design actually results in less code, or is easier to code.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  8. #7
    Member drews's Avatar
    Join Date
    Nov 2002
    Location
    St. Petersburg, Florida
    Posts
    63
    Member #
    341
    Thanks for all your help, this will definately be some trial and error, lots of visits to A List Apart and W3 Schools, and more questions being asked here.

    Thanks again.
    -drews
    -White Fiber Hosting - Coming Soon!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:11 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com