CSS in TD tags

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
toppac
Forum Commoner
Posts: 29
Joined: Fri Jun 14, 2002 10:44 am

CSS in TD tags

Post by toppac »

I want to use stylesheets to set the height and width of my TD tags. I know there is someway you can include stylesheet commands inside of a tag, like

Code: Select all

height="Style:Height 19px"
or something along those lines. Can anyone provide some good example code of how to use inline stylesheets?
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

<td style="height: 40px">
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you may use inline style as you would do in <style>-blocks.
just assign the { ... } stuff to the style-property of the element
<element style="..."> (without { } )

I'm still addicted to Microsoft MSDN but there are lots of other good references

(ok, slam me for beeing a microsoftie :D )
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You can add multiple CSS declarations into a single style attribute like so:

Code: Select all

<td style="width: 20%; height: 10%; background-color: #ffffcc;">
each one just has to be separated by a semi-colon (like PHP). The height and width elements of CSS aren't supported by older browsers (e.g. Netscape 4.x).

Mac
Post Reply