Results 1 to 2 of 2

Thread: Styling My Table Using CSS

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Styling My Table Using CSS

    Hi All,

    I have 2 questions, 1st one is I have a caption above my table, which sits on the extreme left. I also want to have the word 'Download' in the caption but want this to sit on the extreme right any ideas?

    Also I have lots of data to display so have designed up my css so all the table look the same. The only issue is that because some of the headings aren't very long some of the data is moving onto the next line, do I have to manually set a column width in pixels/percent inside every single table? Or can I add something to my css?

    This is how my caption looks...

    [code]
    <table width="700" border="0" cellspacing="0" cellpadding="0">
    <caption>MEMBERS - SEARCH Download Details</caption>
    <thead>
    <tr>
    <th scope="col" class="left">NAME</th>
    <th scope="col">DOB</th>
    <th scope="col">ADDRESS</th>
    <th scope="col">PHONE</th>
    <th scope="col" class="right">MOBILE</th>
    </tr>
    </thead>

  2. #2
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if you wanted different widths for each column, just set the width in pixels in the top row of the table, the rest of the table will follow.

    If you wanted the same width for all columns, add the following to your css:

    Code:
    .tablecolumnwidth{width:200px;}       //Where 200 is the width.
    Then add the following to your first row of <TD> tags:

    Code:
    class="tablecolumnwidth"
    either way will have your column width problem solved.

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
  •