Doctype question, making tables do funny stuff..

liunx

Guest
Hey everyone,<br />
I just went through my site and added :<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<br />
"http://www.w3.org/TR/html4/loose.dtd"><br />
<br />
to the top of each page.<br />
<br />
All of a sudden though, all of the table cells that I have left the horizontal alignment on default are now all centered instead of staying left justified.<br />
<br />
First, is having the doctype at the top of the page even important?<br />
<br />
Second, do you now have to specify a td to be left aligned?<br />
<br />
Third, am I missing something here?<!--content-->for instance...<br />
<br />
this table<br />
--------------------------------------------------------<br />
<table width="200" border="0" cellpadding="2" cellspacing="0" class="greyBorder"><br />
<tr><br />
<td bgcolor="#E4E4E4" class="ta9Bold" align="center"><font color="#990000">Links to Hot Phone Systems</font></td><br />
</tr><br />
<tr><br />
<td height="71" align="left" valign="top" bgcolor="#F4F4F4" class="ta9Bold"><img src=http://www.webdeveloper.com/forum/archive/index.php/"images/hot.gif" width="43" height="23">&nbsp;<a href="packages/1006.asp">&raquo; Option 11c Packages</a><br><br />
&nbsp;&nbsp;&nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/"norstar.asp">&raquo; Nortel Networks Norstar</a><br><br />
&nbsp;&nbsp;&nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/"phonesystems/nortel/cp_100.asp">&raquo; Norstar CallPilot 100</a> <br><br />
&nbsp;&nbsp;&nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/"phonesystems/nortel/cp_150.asp">&raquo; Norstar CallPilot 150</a><br><br />
&nbsp;&nbsp;&nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/"phonesystems/att_lucent/partneracs.asp">&raquo; Avaya Partner ACS</a><br><br />
&nbsp;&nbsp;&nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/"phonesystems/samsung/dcsproducts.asp">&raquo; Samsung DCS</a><br><br />
&nbsp;&nbsp;&nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/"phonesystems/samsung/dcs_ksuc.asp">&raquo; Samsung DCS Compact</a></td><br />
</tr><br />
</table><br />
----------------------------------------------------<br />
without the bolded align="left", the table cell will have everything in it centered. but if I take out the doctype, it goes to the left without the align.<!--content-->also works no matter what in netscape, but in IE im having the problem. I haven't figured it out yet either, and it's buggin the **** out of me. I don wanna go through 950 pages to left align everything. Does anyone have any ideas at all? I've also tried taking the class off of a table cell, same thing. However, if I build a new table, and just plop some text in it, works great. I also told my class for arial 9pt test to be left aligned. worked on one page and that's it.<br />
<br />
<br />
Im confused!:confused:<!--content-->hey plas....<br />
<br />
I'm no expert on the subject...<br />
but if your gonna dip into using DOCTYPE on your pages...<br />
your gonna need to start using CSS for formatting.<br />
<br />
<style type="text/css"><br />
td {<br />
text-align: left;<br />
}<br />
</style><br />
<br />
that should get you started (I hope :rolleyes: )<br />
<br />
;) k<!--content-->I thought about some sort of quick fix for that, however, there are also a lot of table cells that I need be centered as well.<br />
<br />
I wonder if a center command on a TD would override the css?<!--content-->yeah... <br />
or you could create different classes for your <td>s and just reference the classes in the specific columns.<br />
<br />
try to make your life easy...<br />
set it up right the first time...<br />
then any changes that are needed later can be done globally via css<br />
<br />
just a bit of advice...<br />
;) k<!--content-->True, I thought I had already done that lol...<br />
whoops. I have a huge style sheet going now, I dunno why this is all of a sudden goofy. I put in the doc type to correct some other css problems with backgrounds behind words instead of table cells across ie and ns, but it's created me this problem....so.. one way or the other, Im going to have to go do something to each cell. unless I can figure out whats going on. I can make a new table, and it will do just great, but all my old ones....goofy<br />
<br />
still working on it though, Ill let you know if I find a fix<br />
it's wierd. I can't yet seem to find the root of the problem, especially considering the inconsistancy...<!--content-->OK, I figured something out.<br />
<br />
Here's what's happening.<br />
<br />
Sometimes I use nested tables. Sometimes, these nested tables are contained inside a table cell that is iteself centered with a td align...<br />
<br />
whats happening is, the nested table is inheriting the bigger cells format!!!!!!!!!!!!!!!!!!!!!!!!!!!<br />
<br />
now...what to do about it...either way, it's a mess.<!--content-->hmmmm.....<br />
I guess that I'll say it first (since not everybody is as sweet as me in how they say these things :) )<br />
<br />
don't use tables for layout (especially nested tables)<br />
<br />
but... <br />
if you are going to use tables...<br />
position them with CSS (not nesting)<br />
<br />
although (and I gotta say this or I will get creamed!)...<br />
you really shouldn't use tables for positioning.<br />
<br />
sorry...<br />
but better me than some of the more "stern" voices in here :)<br />
<br />
;) k<!--content-->I know i know....Im actually getting around to that, but it's tough trying to manage the whole site, the pricing, the marketing, the redesigns, the phone call, the finances, the kids (employees) and have a life too....so im going in slow stages. I finally got allllll of my navigation to NOT be in a nested table, and that's what lead me here. I've been hitting it hard, but I gotta go in stages as they are feasible.<br />
<br />
I personally think a site without table would be very very cool and nice, just haven't gotten that far yet. :rolleyes: im tired, ugh. Thanks for the help Jersey Girl!<!--content-->
 
Back
Top