Stefan Says

Opinions on ASP.NET, ASP, databases etc
posts - 34, comments - 25, trackbacks - 23

The CSS and tables problem

While I am really starting to appriciate the power of CSS there are some certain drawbacks which drives me nuts. Beside the obvious about CSS - the possiblity to separate layout and content - the power lies in the CSS - where C stands for cascading.

However you gotta be really careful cause soon enough you will have trouble knowing which styles will be inherited or not. One thing I miss (correct me if I am wrong) is however a possibility to - for a certain item - break the inheritance chain, this element should NOT inherit any style but rather start from the "fresh" default style.

One example of this I have been struggling lately is tables. For AdMentor PRO I use some heavy table formatting:

Live demo

Now, what if I want to include, say a datepicker Javascript component for one of the fields. Since most Javascript datepickers are implemented as tables, all styles from the outer table WILL be cascaded down to the datepicker - no matter what. Since the new table is contained inside...

What I am left to do is try to reverse all settings from the outer table,th,tr,td etc for the datepicker component...That was not so fun at all, and I didn't even get an result good enough. Somehow some cellspacing or margin or something got carried over so it didn't look ok. I simply guess I have more to learn about that.

Print | posted on Friday, May 11, 2007 9:56 AM