Tables, bordercolor and CSS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Torbjørn Pettersen

    Tables, bordercolor and CSS

    I have two tables, and I want one of them to use bordercolor.
    How can I do this with CSS. The W3.com's validator tells me
    that bordercolor isn't valid any more, so I have to push it into
    the CSS, but how do I do this? I am, by the way, using
    DreamWeaver as my main design tool.

    --
    Torbjørn Pettersen
    Editor/Webmaster
    FantaFiction




  • Torbjørn Pettersen

    #2
    Re: Tables, bordercolor and CSS

    I wrote...[color=blue]
    > I have two tables, and I want one of them to use bordercolor.
    > How can I do this with CSS. The W3.com's validator tells me
    > that bordercolor isn't valid any more, so I have to push it into
    > the CSS, but how do I do this? I am, by the way, using
    > DreamWeaver as my main design tool.[/color]

    <foolish grin>
    OK, I found the solution. Was actually pretty simple.

    Used this in the CSS file:
    ..myTable {

    padding: 0;
    margin: 0;
    border-width: 1;
    border-color: #996600;
    border-style: solid;
    }

    And this in the HTML (ASP) file:
    ..table class="myTable"
    </foolish grin>

    It's incredible what Google can find for you when you use the right
    search phrase. ;-)

    --
    Torbjørn Pettersen
    Editor/Webmaster
    FantaFiction




    Comment

    • Torbjørn Pettersen

      #3
      Re: Tables, bordercolor and CSS

      I wrote...[color=blue]
      > I have two tables, and I want one of them to use bordercolor.
      > How can I do this with CSS. The W3.com's validator tells me
      > that bordercolor isn't valid any more, so I have to push it into
      > the CSS, but how do I do this? I am, by the way, using
      > DreamWeaver as my main design tool.[/color]

      <foolish grin>
      OK, I found the solution. Was actually pretty simple.

      Used this in the CSS file:
      ..myTable {

      padding: 0;
      margin: 0;
      border-width: 1;
      border-color: #996600;
      border-style: solid;
      }

      And this in the HTML (ASP) file:
      ..table class="myTable"
      </foolish grin>

      It's incredible what Google can find for you when you use the right
      search phrase. ;-)

      --
      Torbjørn Pettersen
      Editor/Webmaster
      FantaFiction




      Comment

      • brucie

        #4
        Re: Tables, bordercolor and CSS

        in post: <news:407bc80d$ 1@news.broadpar k.no>
        "Torbjørn Pettersen" <tpe AT broadpark DOT no> said:
        [color=blue]
        > I have two tables, and I want one of them to use bordercolor.
        > How can I do this with CSS.[/color]

        #blah{border:1p x dotted green;}

        <table id="blah">
        [color=blue]
        > The W3.com's validator tells me that bordercolor isn't valid any more,[/color]

        it never was valid

        --
        b r u c i e


        Comment

        • brucie

          #5
          Re: Tables, bordercolor and CSS

          in post: <news:407bc80d$ 1@news.broadpar k.no>
          "Torbjørn Pettersen" <tpe AT broadpark DOT no> said:
          [color=blue]
          > I have two tables, and I want one of them to use bordercolor.
          > How can I do this with CSS.[/color]

          #blah{border:1p x dotted green;}

          <table id="blah">
          [color=blue]
          > The W3.com's validator tells me that bordercolor isn't valid any more,[/color]

          it never was valid

          --
          b r u c i e


          Comment

          • Steve Pugh

            #6
            Re: Tables, bordercolor and CSS

            "Torbjørn Pettersen" <tpe@broadpark. no> wrote:
            [color=blue]
            >I have two tables, and I want one of them to use bordercolor.
            >How can I do this with CSS.[/color]

            Same as any other element, but be aware that whilst the border
            attribute of <table> in HTML affects both the table and its
            constituent cells the border property in CSS can affect table and
            cells separately.
            [color=blue]
            >The W3.com's validator tells me that bordercolor isn't valid any more,[/color]

            It never was.
            [color=blue]
            >so I have to push it into the CSS, but how do I do this?[/color]

            table {
            border-color: #FF0000;
            }

            td, th {
            border-color: #0000FF;
            }

            Give red borders around the table and blue borders around the
            individual cells. Set border-width, border-style, border-collapse and
            border-spacing as well for more options.

            See http://www.w3.org/TR/CSS21/box.html#border-properties

            Steve

            --
            "My theories appal you, my heresies outrage you,
            I never answer letters and you don't like my tie." - The Doctor

            Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

            Comment

            • Steve Pugh

              #7
              Re: Tables, bordercolor and CSS

              "Torbjørn Pettersen" <tpe@broadpark. no> wrote:
              [color=blue]
              >I have two tables, and I want one of them to use bordercolor.
              >How can I do this with CSS.[/color]

              Same as any other element, but be aware that whilst the border
              attribute of <table> in HTML affects both the table and its
              constituent cells the border property in CSS can affect table and
              cells separately.
              [color=blue]
              >The W3.com's validator tells me that bordercolor isn't valid any more,[/color]

              It never was.
              [color=blue]
              >so I have to push it into the CSS, but how do I do this?[/color]

              table {
              border-color: #FF0000;
              }

              td, th {
              border-color: #0000FF;
              }

              Give red borders around the table and blue borders around the
              individual cells. Set border-width, border-style, border-collapse and
              border-spacing as well for more options.

              See http://www.w3.org/TR/CSS21/box.html#border-properties

              Steve

              --
              "My theories appal you, my heresies outrage you,
              I never answer letters and you don't like my tie." - The Doctor

              Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

              Comment

              • Saqib Ali

                #8
                Re: Tables, bordercolor and CSS

                Try this:


                table {
                border: 1px solid #99660;
                border-collapse: collapse;
                padding: 2px;
                margin-top: 0.5em;
                margin-bottom: 0;
                }


                "Torbjørn Pettersen" <tpe AT broadpark DOT no> wrote in message news:<407bc80d$ 1@news.broadpar k.no>...[color=blue]
                > I have two tables, and I want one of them to use bordercolor.
                > How can I do this with CSS. The W3.com's validator tells me
                > that bordercolor isn't valid any more, so I have to push it into
                > the CSS, but how do I do this? I am, by the way, using
                > DreamWeaver as my main design tool.[/color]

                Comment

                • Saqib Ali

                  #9
                  Re: Tables, bordercolor and CSS

                  Try this:


                  table {
                  border: 1px solid #99660;
                  border-collapse: collapse;
                  padding: 2px;
                  margin-top: 0.5em;
                  margin-bottom: 0;
                  }


                  "Torbjørn Pettersen" <tpe AT broadpark DOT no> wrote in message news:<407bc80d$ 1@news.broadpar k.no>...[color=blue]
                  > I have two tables, and I want one of them to use bordercolor.
                  > How can I do this with CSS. The W3.com's validator tells me
                  > that bordercolor isn't valid any more, so I have to push it into
                  > the CSS, but how do I do this? I am, by the way, using
                  > DreamWeaver as my main design tool.[/color]

                  Comment

                  Working...