Results 1 to 3 of 3

Thread: table.rc { } vs rc table { }

  1. #1
    Join Date
    Oct 2008
    Posts
    15
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default table.rc { } vs rc table { }

    I'm trying to define a custom table in css that won't effect other tables not specified by the class. I confused about the naming convention, I've seen both, but is there a difference between these:

    table.rc { }

    rc table { }

    Thanks

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    table.rc means any table with the class value rc

    rc table is wrong. I'm guessing you mean .rc table which means any table within any element with a class value rc

    Class values always start with a period when you target them in CSS. If a class value is attached at the end of an element (element.class) it means that the element much have that class value to be targeted.

    If there are two elements in a row with a space in between (element element) it means that the second element much be a child of the first element to be targeted.

    When having class values without any element (.class) it means that any element with that class value is targeted.

    So for instance div.wrap .nav li a.home targets all anchor tags with a class value of home (a.home) that are child elements to any list items (li) that are child elements to any elements with a class value of nav (.nav) that are child elements to any divisions with a class value of wrap (div.wrap).

    So in your case, if you want to target a specific table, you could give the table a class value and then use table.classvalue

    I hope that is clear enough, if not, just ask.

    Good luck!

  3. #3
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    If you want to define a table type that does not affect other tables you make a class, using your example table.rc{}

    In your HTML you use this class by <table class="rc>

    I must admit to not having seen this expressed as 'rc table', I tested it out and it did not appear as a class this way.

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
  •