how to define properties of table border with css?

Discussion in 'HTML' started by Bernd Meier, Jan 13, 2008.

  1. Bernd Meier

    Bernd Meier Guest

    I defined table.propertiesfortables {color:green; background-color:#FFFF00;
    border="5" solid blue} as CSS.
    I start my table with the tag: <table class=propertiesfortables>

    Font is green and background yellow but I didn't get border lines.
    But if I use table.propertiesfortables {color:green;
    background-color:#FFFF00}
    as CSS and then begin table tag with <table class=propertiesfortables
    border="5" solid blue>
    I get blue border line.

    Why don't I get blue border lines for my table with first example with CSS
    and what have
    I to change to get them with CSS?
     
    Bernd Meier, Jan 13, 2008
    #1
    1. Advertisements

  2. Bernd Meier

    Jeff Guest

    Bernd Meier wrote:
    > I defined table.propertiesfortables {color:green;
    > background-color:#FFFF00; border="5" solid blue} as CSS.


    for one thing that isn't correct CSS.

    try: border: solid blue 5px

    for another, do you want a border around the table or the cells?:

    table.propertiesfortables td{border: solid blue 5px;}

    Also look up border-collapse: collapse

    Styling tables with CSS is a different animal than you think.

    I'm sure there must be a tutorial around somewhere on this.



    > I start my table with the tag: <table class=propertiesfortables>
    >
    > Font is green and background yellow but I didn't get border lines.
    > But if I use table.propertiesfortables {color:green;
    > background-color:#FFFF00}
    > as CSS and then begin table tag with <table class=propertiesfortables
    > border="5" solid blue>


    Good html procedure is to use quotes
    <table class="propertiesfortables"

    Jeff



    > I get blue border line.
    >
    > Why don't I get blue border lines for my table with first example with
    > CSS and what have
    > I to change to get them with CSS?
     
    Jeff, Jan 13, 2008
    #2
    1. Advertisements

  3. Bernd Meier

    J.O. Aho Guest

    Bernd Meier wrote:
    > I defined table.propertiesfortables {color:green;
    > background-color:#FFFF00; border="5" solid blue} as CSS.
    > I start my table with the tag: <table class=propertiesfortables>
    >
    > Font is green and background yellow but I didn't get border lines.


    table.propertiesfortables {
    color:green;
    background-color:#FFFF00;
    border: 5px solid blue;
    }

    As you see you don't use any '=' in CSS, you use the ':' instead.


    --

    //Aho
     
    J.O. Aho, Jan 13, 2008
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ree

    CSS Table border problem

    ree, Dec 4, 2003, in forum: HTML
    Replies:
    2
    Views:
    543
  2. Shailesh Humbad

    HTML and CSS Table Border Style Wizard

    Shailesh Humbad, May 11, 2004, in forum: HTML
    Replies:
    13
    Views:
    7,888
    Day Bird Loft
    May 18, 2004
  3. Edward Scott
    Replies:
    10
    Views:
    1,028
    kchayka
    Oct 16, 2005
  4. Paul Lautman
    Replies:
    4
    Views:
    570
    Spartanicus
    Mar 27, 2006
  5. phl
    Replies:
    1
    Views:
    4,709
    Martin Jay
    Jun 8, 2006
  6. Replies:
    3
    Views:
    1,126
    richard
    Sep 24, 2006
  7. Replies:
    8
    Views:
    915
    Jonathan N. Little
    Feb 1, 2007
  8. =?Utf-8?B?cm9kY2hhcg==?=

    html table border attribute and css

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    588
    =?Utf-8?B?cm9kY2hhcg==?=
    Oct 5, 2007
Loading...