Jump to content

Restricting size of single column width in table


Eiolon

Recommended Posts

I have a table that holds data.  It has 4 columns, 3 do not have any width restrictions but I want the 4th one to have a restriction.  How do I tell my stylesheet that this particular column gets a width while the others do not?

 

<table class="data">
<tr>
  <th>Name</th>
  <th>Address</th>
  <th>Phone</th>
  <th align="center"></th>
</tr>
<tr>
  <td></td>
  <td></td>
  <td></td>
  <td align="center"></td>
</tr>
</table>

 

table.data {
width: 100%;
border: 1px;
border-collapse: collapse;
border-top: 1px solid #CCCCCC;
border-left: 1px solid #CCCCCC;
border-bottom: 0px solid #CCCCCC;
border-right: 1px solid #CCCCCC;
background-color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
color: #000000
}

table.data th {
background-color: #E5E5E5;
padding-top: 5px;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
border-top: 0px solid #CCCCCC;
border-left: 0px solid #CCCCCC;
border-bottom: 1px solid #CCCCCC;
border-right: 1px solid #CCCCCC
}

table.data td {
padding-top: 5px;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
border-top: 0px solid #CCCCCC;
border-left: 0px solid #CCCCCC;
border-bottom: 1px solid #CCCCCC;
border-right: 0px solid #CCCCCC
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.