Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to define width/heigth in a CSS?

Status
Not open for further replies.

LucyL

Technical User
Feb 20, 2002
113
US
Hi,
I am new to CSS. I have a html page that looks quite messy since I have defined different width/heigth for the cells etc. Is there any way I can tidy this up into a CSS, and reference it from the html page?
Help appreciated.
 
Hi Lucy, if your cells have common widths/heights then you can use CSS to specify the them as below.
Also this would have an advantage in that you can specify cell bgColors/text alignment etc from these styles at the same point.

<style>
td.blah {width:'50px'; height:'100px'}
td.blah2 {width:'20px'; height:'70px'}
</style>

<table>
<tr>
<td class=&quot;blah&quot;>
blah blah blah
</td>
</tr>
<tr>
<td class=&quot;blah2&quot;>
blah2 blah2 blah2
</td>
</tr>
</table>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top