SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: css help

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    London
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css help

    Hi, I'm want to use the border code in css:

    (Re: last question on vertical line in forum and response) 'You could use CSS to define your Vertical line as there is no Vertical equivalent for <HR>

    http://www.w3schools.com/css/pr_border-left.asp'

    However, because I use several tables on my page the vertical line appears on all of these. How do I specify a particualar table to have the border in CSS?....

    Hope someone can help

  2. #2
    SitePoint Member
    Join Date
    Mar 2002
    Location
    Melbourne, Australia
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess you could apply the table cell with a CLASS referall tag. Making sure you only apply this to the cell you would like the Vertical line.

    eg. <TD CLASS="BORDER"></TD>

    This will then pass the cells formatting to your setup within your CSS style in your <HEAD></HEAD> tags.

    eg.

    <HTML>
    <HEAD><TITLE></TITLE>
    <STYLE TYPE="text/css">
    .BORDER {
    insert your border setup here
    }
    </STYLE>
    </HEAD>

    I hope this helps, and is what your after!
    Last edited by cyborg; Mar 18, 2002 at 01:15.
    'Where's Your Head @?'

  3. #3
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    woah cyborg you better fix your voice-production unit... seems like the volume's set to the max

    yup you should specify a particular class and use it in tables you want the border for...

  4. #4
    SitePoint Member
    Join Date
    Mar 2002
    Location
    Melbourne, Australia
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL! I was testing the code you could use in the reply! Some code just don't work!
    'Where's Your Head @?'

  5. #5
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To improve upon Cyborg's example, it is better to add the selector of a given class instead of only the class itself, that way the class is specified as belonging to one specific type of element (in this case, a table):
    Code:
    <html>
    <head>
    <title></title>
    <style type="text/css">
    <!--
    table.border { insert your border setup here }
    -->
    </style>
    </head>
    <body>
    <table class="border"> ...
    There's the valid version of Cyborg's excellent example.

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

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    London
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi guys thanks for your quick response, unfortunately I still cannot get it to work. As I'm not all that familiar with css, I'll tell you what I've put there and maybe you can help me out with it. At the moment the page is displaying exactly the same - no changes.

    I'm using an external style sheet which I have linked in the head section of my page. The style sheet has this code:

    table.border {right: thin #663366}

    I want the border to appear on the right of the table, be thin and a color)

    Further down the page I added the code where I wanted the line to appear; in the table tags I have put:

    <table class="border" width="20%" border="0" cellpadding="3" cellspacing="0">

    Hope this makes sense and can help out!

  7. #7
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    the "border" part you have written is just a name you've issued to that class. It could have been table.foo or table.dancing , providing the class="foo" bit corresponds.

    As such, there's a bit missing from the next part. Try this:

    PHP Code:

    table
    .border {border-rightthin #663366} 
    then make sure the table has the class of "border"



    H
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  8. #8
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's still a little off, TheOriginalH. You never defined what kind of border it would be (solid, dashed, double, etc.).

    Code:
    table.border {
      border-right: thin solid green;
    }

  9. #9
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well spotted - my bad.
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  10. #10
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    London
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RAD.....IT WORKS....A BIG THANKS TO YOU ALL


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
  •