Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    d_m
    d_m is offline
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Stylesheet or inline styles for my table?

    I am currently developing a website and i need to display spreadsheets of data, so i am doin this using tables. I have it all set up and am ready to style it, mainly altering background colours, and font properties such as weight, color and size and the tables have different width. I have many different tables, one being used many times.

    Would like some advice on how to style these, usually id do it using inline styles, but i found myself repeating things lots. For example one table is displaying a simple calendar of events grouped by each month. i felt that as the row containing the month name was styled the same for each month, but different from the rest of the data in the table i was repeating the same code for each month. Would it be simpler to style my tables using an external style sheet using table id, and tr id? or just carry on with the inline styles? I have attempted using the style sheet but I have now run into problems.

    I havent got much experience with tables as i generally stay clear from them

    Thanks

  • #2
    Regular Coder
    Join Date
    Mar 2008
    Posts
    235
    Thanks
    6
    Thanked 21 Times in 20 Posts
    stylesheet, always stylesheet but IE6 is known for ignoring CSS applied to tables on certain things like width, specifying col width and valign would probably be best left inline, but anything else like colouring fontsizes etc should be in a stylesheet
    Andrew Sharman
    Web designer, developer and programmer.

    If you found my post helpful, why not give thanks! :)

  • #3
    d_m
    d_m is offline
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so i would be right in what ive done so far:

    HTML:
    table id="events">
    <tr id="title">
    <td>Date</td>
    <td>Event</td>
    <td>Venue</td>
    </tr>

    <tr id="month">
    <td colspan="5">&nbsp;January</td>
    </tr>
    <tr>
    <td>Sunday 18<sup>th</sup></td>
    <td>RTV</td>
    <td>Fetteresso</td>
    </tr>.......

    STYLESHEET:
    #events {
    width:780px;
    border:none;
    }

    #title {
    color:#A5E543; /* green */
    font-weight:bold;
    }

    #month {
    background-color:#A5E543; /* green */
    color:#000000; /* black */
    font-weight:bold;
    }

  • #4
    d_m
    d_m is offline
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by udjamaflip View Post
    stylesheet, always stylesheet but IE6 is known for ignoring CSS applied to tables on certain things like width, specifying col width and valign would probably be best left inline, but anything else like colouring fontsizes etc should be in a stylesheet
    I have went ahead and done this and when validating the html it gave a fair number of errors


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •