Applying multiple styles to one TD element
Posted on 2004-08-06
First off, this might sound like a strange question but bear in mind that the HTML is being dynamically generated and this is why I need to do it this way...
I have TD elements e.g. <TD class=format1>
The problem is that my TD.format1 style does not define any borders, just fonts and colors and indenting and such. I do not want to put border information in the format1 style.
I also want to apply borders to the TD.
Right now I am doing it this way: <TD class=format1 style='border-left: solid 1pt #3366ff; border-right: solid 2pt #66DDFF; border-top: dotted 3pt #FFCCEE;'>
as you can see this is very verbose... if I'm going to have many tens or hundreds of thousands of TDs then this adds much size to the file.
My understanding is that CSS does not allow something like this: class=format1,border1 . If it did support this then that would be ideal since I have a limited number of border styles and can construct a <STYLE>...</STYLE> listing all of them.
Can anyone think of a way to do what I want to do in a less verbose manner?