IE8 in standard mode disobeys cell width

  • lzr
  • Novice
  • Novice
  • lzr
  • Posts: 28

Post 3+ Months Ago

Hi,
I have a table with two columns. I specify the width of the entire table and the width of one of its columns. So, a browser should determine the other column's width automatically. It works fine in Firefox and older IEs, but IE8 seems to disobey the width of the cell and screws alignment unless I select its compatibility mode.
The page DOCTYPE declaration is
<! html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ***/TR/html4/loose.dtd">
It passes W3C validation as HTML 4.01 transitional and with minor exception even as HTML 4.01 strict.
Microsoft website says in IE8 "sites designed for older versions of the browser may not display as intended".

I am puzzled, what's "older" in specifying a cell width that IE8 would not follow it correctly?
(I had to put asterisks in above url since it won't let me post links).
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

"width" is deprecated if used in <hr>, <pre>, <td>, <th>. Use CSS to specify the width. That would be the correct way.

See here for more info
  • lzr
  • Novice
  • Novice
  • lzr
  • Posts: 28

Post 3+ Months Ago

ATNO/TW wrote:
"width" is deprecated if used in <hr>, <pre>, <td>, <th>. Use CSS to specify the width. That would be the correct way...


I do specify td width as a style, i.e. <td style="width: 100px;">
Is not it the same as using CSS?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

That could be the problem. You really should try to avoid inline style like you are doing. That is not the correct way.

Some reading:
http://webdesign.about.com/od/css/a/aa073106.htm
http://www.cssnewbie.com/inline-in-docu ... inked-css/
http://www.hitmill.com/dhtml/css/inline.html

An example of when to use an inline style would be something like this.
You want all the paragraphs of your website to be styled the same except for 6 of them on one particular page, and of those 6 you want one to be styled the same but with a different color.

So for your site you style your paragraphs in an external style sheet. For the 6 on the one page you style those in an embedded style, and for the one that is a different color you style the color inline.
  • lzr
  • Novice
  • Novice
  • lzr
  • Posts: 28

Post 3+ Months Ago

ATNO/TW wrote:
That could be the problem. You really should try to avoid inline style like you are doing. That is not the correct way.


Thanks for the reference. I realize inline style may not be the best way to go, but it still does not explain why IE8 disobeys it (unless it is a bug). I tried specifying the width with <col> and it did not work either. It does work if I specify the width of both columns though (something I did not want to do to avoid the issues of width of content vs. width of the box).

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 72 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.