SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2002
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation CSS and Positioning

    When I'm positioning or defining a table for example with HTML and CSS, what should I use to put the CSS style="" on the page?

    <P> or <EM> or <DIV> or <SPAN>

    Which of the above would I use to position a table? Here I'm using DIV.

    <div style="left: 10; top: 0; width: 200; height: 80; position: absolute">

    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="350" height="90">

    <tr>
    <td width="33%" style="border-bottom: 10px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; font-family:Verdana; font-size:8pt" height="80" valign="top">

    Hello

    </td>
    </tr>
    </table>
    </div>


    I don't want something that will insert a line break or any added positioning (I believe P begins a new Paragraph correct?)

    Thanks in advance,
    Cosmic.

  2. #2
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use div when encapsulating block level elements such as tables and the like. Typically, <p> and <span> are only used on text and other non-block level elements.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CosmicCatalyst,

    Personally, I would do something like this:
    Code:
    <head>
    <style type="text/css">
    <!--
    #thisTable {
      border-collapse: collapse;
      height: 80;
      left: 10;
      position: absolute;
      top: 0;
      width: 200;
    }
    -->
    </style>
    </head>
    And then
    Code:
    <table id="thisTable">

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Aes
    Use div when encapsulating block level elements such as tables and the like. Typically, <p> and <span> are only used on text and other non-block level elements.
    -Colin
    Colin...

    P is a block level element.

    DIV is the recommended container for block level elements. SPAN is the container I use for inline elements.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by creole
    Colin...

    P is a block level element.

    DIV is the recommended container for block level elements. SPAN is the container I use for inline elements.
    Ahh, so it is.... Well ... erm that is what I meant actually Andy. You must've misinterpreted what I said.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.


Bookmarks

Posting Permissions

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