Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Alignment tricks in CD2

After reading the mails here since the v2 beta release one could almost get the impression that we were all better of with CD1 despite all it's bugs. That can't be the truth ... can it?

The latest thing I stumbled upon was this little "trick":

<td bgcolor="#008000" align="center">

After CD2 had done it's secret adjustments:
<td bgcolor="#008000" align="middle">

According to O'Reilly's Dynamic HTML 2nd Edition there is no such thing as "middle" for table data alignment, and the trick caused Mozzilla to do a left align instead while IE didn't mind.

I tried to change the tag back, but CD insisted on "middle". :-(

Jorgen Brenting
Sunday, May 11, 2003

Just for clarification - are you saying that CityDesk 1.0 did not do this?

Joel Spolsky
Sunday, May 11, 2003


Please note that this is not a complaint. I'm aware that CD2 is still in Beta.

Jorgen Brenting
Sunday, May 11, 2003

It seems that I was a little hasty in my first answer to your question about CD1/CD2 changing "center" to "middle". Having checked further it looks more like an arbitrary effect in CD1. Sometimes it's align="center" sometimes it's align=middle (with the quotes removed). I can't find a pattern but having checked many uploaded files from CD1 I have found a little of each with no clear pattern as far as I can see.

Jorgen Brenting
Monday, May 12, 2003

I can confirm (beacuse I'm validating to a DTD :-) that this behaviour does occur. I've had up to (say) 40 occurences a page to correct (on price lists).

I don't have any numbers on it though.

If I get some time I'll have look.


James Roberts
Monday, May 12, 2003

I'm a proponent of using html for structure and css for style.  I know there are lots of people who are used to doing both in html.

But, if you use css to style your html you end up not running into the weirdness of the html editor as often.

As for middle and center, I think the standard says one thing and NS uses one term and IE uses the other.

Joel Goldstick
Thursday, May 15, 2003

The only problem with CSS is that there is still problems with CSS when it comes to more than bacis formatting. This will be solved eventually, but until then tables etc. are often the best way to ensure that your layout is shown (almost) as you want it.

I'm not religious about this, as I know some people are, I'm just using what works best right now in the real world.

Jorgen Brenting
Thursday, May 15, 2003

*  Recent Topics

*  Fog Creek Home