DHTML Lab - DHTML Diner - Element Page Coordinates, Part 3 | 7
Determining Element Page Coordinates, Part 3
And, naturally, you should move the blue square. The functions used to position the square are the ones developed on the previous page. They won't always get it right!
<TABLE BORDER FRAME RULES CELLSPACING=0 CELLPADDING=0 BORDERCOLOR=#3AF600> <COLGROUP SPAN=2 WIDTH=50> <TR><TD> </TD><TD> </TD> <TD> </TD></TR> <TR> <TD> </TD><TD> </TD><TD> </TD> </TR> <TR> <TD> </TD><TD> </TD> <TD><IMG ID="redbox" SRC="redbox.gif" WIDTH="200" HEIGHT="200"></TD> </TR> </TABLE>
The RULES attribute is supported only by NS7 and Mozilla 0.9.9+. You will witness no in-page changes if you are using NS6 or Mozilla 0.9.8-.
The "groups" value for the RULES attribute is incorrectly rendered by Gecko for COLGROUP. The Gecko documentation states that RULES="groups" renders "lines between groups only" but in the case of COLGROUP, lines are rendered between every column in the group.Try the combination [ BORDER, FRAME, RULES = "groups" ] in both IE and NS7 if you can.
Omitting a value for BORDER or declaring an invalid value (eg. "foobar") is the same as BORDER = "1" This is legacy behavior and all browsers support it.
Omitting the BORDER attribute altogether is the same as BORDER = "0".
Omitting a value for FRAME, or declaring an invalid value (eg. "foobar") is the same as FRAME = "border". This is different from the IE behavior. Try the combination [ no BORDER attribute, FRAME, RULES ] in both IE and NS6+ if you can.
Omitting the FRAME attribute altogether is the same as FRAME = "void". This, too, is different from the IE behavior.
In Gecko, the properties return an empty string, but the methods return null, so by using the method, it is easy to check for the existence of an attribute.
but most importantly...
Omitting the BORDER attribute and including FRAME in any way (no value, invalid value, valid value) causes a one-pixel error in positioning. Try:
[ no BORDER attribute, any FRAME option except for 'no FRAME attribute', any RULES option ]
Even if no frame is displayed there is still a one-pixel error! It's as if a frame is always included in the browser calculations, regardless of screen display.
We'll address this final note on the next page.
Produced by Peter Belesis andAll Rights Reserved. Legal Notices.
Created: Oct 16, 2002
Revised: Oct 16, 2002