Is it a bug??

message from ADSltd on 22 Jul 2004
Hi, I have been trying to center ... anything in a table cell both horiz. and
vert. .
With the following code the text is centered in dreamweaver but when i view
it in a browser it is only v aligned not h aligned.
Can anyone help ??

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test Doc</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
 
Murray *TMM* replied to ADSltd on 22 Jul 2004
It's a bug. But it's in your understanding of HTML, unfortunately!

Here's the deal.

A doctype on an HTML page tells the browser how to render the page. If
there is no doctype, or if there is an invalid one, the page is rendered in
quirks mode. If there is a valid doctype, the page is rendered in standards
mode.

DMX inserted a broken doctype on the page (i.e., functionally equivalent to
no doctype). Earlier versions inserted NO doctype. Hence, all these pages
are rendered in quirks mode.

In quirks mode, the browser makes an attempt to render invalid HTML. Not
all browsers attempt the same rendering - so you will see a variety of
differences, comparing one browser to the next on the same page.

In standards mode, the browsers all render the same (so they say - but in
practice, while not true, it's much more uniform).

Table height is invalid HTML. It always has been - it was never a part of
HTML's specs.

Browsers in quirks mode will try to render table heights. Browsers in
standards mode willl not.

Geddit?
 
adsit replied to Murray *TMM* on 23 Jul 2004
Ok And Ouch thanks for the dig man!! :(

1. I thought I understood the concept of quirks mode and standards mode. But
now im not sure.
...Hence, all these pages are rendered in quirks mode.
....Browsers in quirks mode will try to render table heights.
Why did it not render the centred text then?

2. Is this an error with DMX then and therefore a bug?
DMX inserted a broken doctype on the page
I dont understand what you mean by broken doctype. Is this a return break in
the address code. If it is I have fixed this before and it makes no difference.

2. how do i rectify the situation so it centres the text for me?
I am at a loss here any help on fixing the problem would be appreciated. Also
any explanation on a best practice would be beneficial to my 'Buggy' Knowledge?
 
Murray *TMM* replied to adsit on 23 Jul 2004
Yes.

Yes - and some succeed the way you would think. Others do not. Sorry, I
can't remember which....

I'm not sure - I'll have another look at your code.

Yes, it's a bug with DMX. The doctype insertion was fixed with DMX2004.
You can fix it yourself in DMX by simply editing the default.html file (it's
in C:\Program Files\Macromedia\Dreamweaver MX
2004\Configuration\DocumentTypes\NewDocuments on my WXPPro) to replace the
current doctype line with this one -

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
(assuming you want loose standards mode)

You can read more about doctypes here - http://www.w3.org.

Change this -

<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr align="center" valign="bottom">
<td valign="middle" class="normal">You have successfully added an
Emoployee to the Database<br>
<a href="add_emp.php">Click here to add another</a></td>
</tr>
</table>

to this -

<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td valign="middle" class="normal" align="center">You have
successfully added an Emoployee to the Database<br>
<a href="add_emp.php">Click here to add another</a></td>
</tr>
</table>

And for heavens sakes, spell employee properly! 8)
 
adsit replied to Murray *TMM* on 23 Jul 2004
Thanks for sticking with this one Murray

I am using DMX2004 and that is the header it created. I think I better read
more about the headings as I don?t know which is better to go for. I would
initially lean towards the standards. one but ill read more.

Does anyone have any practical advice on which to use.? To add to the pot?
I?m developing with LAMP don?t know if that makes any difference!

PS You never heard of an em o ployee!!!?? ;)

Orbi
 
Gary White replied to adsit on 23 Jul 2004
I've since heard that it's IE5/Mac that doesn't work. I'll add that info
to the page when I get a chance.

Gary
 
Gary White replied to adsit on 23 Jul 2004
See http://apptools.com/examples/tableheight.php

Gary
 

Archived message: Is it a bug?? (Macromedia Dreamweaver)