SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I try to make a table layout in a stylesheet but I just can't get it to work.
    I need the following sort of table:

    Cellspace 0
    Border 1
    Border Color Black

    All the lines in the Table have to be 1 pixel wide and black, Not just the lines on the sides of the table.

    I've tried for hours.
    Halleeluja for stylesheets.

    networktm

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You only need stylesheets for SOME of the things you want.


    <style type="test/css">
    <!--

    table {
    border-color: #000000;
    border-width: 1px;
    border-style: solid;
    margin: 1px;
    }

    -->
    <style>

    But to be cross-browser compatible, you still have to set some of the values in the TABLE tag itself.

    <table cellpadding="0" cellspacing="1" width="500">
    <tr>
    <td>content</td>
    <td>content</td>
    <td>content</td>
    </tr>
    <tr>
    <td>content</td>
    <td>content</td>
    <td>content</td>
    </tr>
    <tr>
    <td>content</td>
    <td>content</td>
    <td>content</td>
    </tr>
    </table>

    by the way, this is a great reference for CSS:
    http://www.zvon.org/


    <edit>
    I am trying this and it doesn't seem to be working...I will post the result when I get it right
    </edit>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try the following:

    Code:
    <style>
    table {
      border-collapse: collapse;
    }
    td {
      border-style: solid;
      border-width: 1px;
      border-color: #000000;
    }
    </style>
    NB: The border-collapse attribute can cause some of the borders not to render in some browsers.

  4. #4
    SitePoint Member
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    It works!!!

    Shane, you had the right solution.

    Thanx for helping Shane and Creole!

  5. #5
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glad we could help.

    I normally turn to the W3C's CSS specification when I get stuck with CSS stuff. The pdf version makes a handy reference.

    http://www.w3.org/TR/REC-CSS2/


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
  •