SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Set table first column width in CSS

    Dear all, for my table below, how can i set the width of the first column please?

    Code:
    <table>
        <thead>
            <tr>
                <th></th>
                <th>Standard</th>
                <th>Performance</th>
                <th>Ultimate</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <th scope="row">desc</th>
                <td>a</td>
                <td>b</td>
                <td>c</td>
            </tr>
        </tbody>
    </table>
    Please note I have tried a selector on the below but it doesn't affect the column width:

    Code:
    tbody tr th
    {
    text-align:right;
    column-width: 250px;
    }

  2. #2
    SitePoint Enthusiast scout1idf's Avatar
    Join Date
    Nov 2009
    Location
    Ohio
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this.....

    Code:
    tbody th{
    text-align:right;
    }
    th:nth-child(1){
         width:250px;
    }


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
  •