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
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.