 Inside Technique : Cool Rules : Client-side Generation
When we finished this function and tested it in Internet Explorer 4.0 we got very excited as
the rules are a very nice effect. We expected this to run cross-browser because the code just generates and inserts a table into the page. While the table renders
fine in both browsers when generated by hand, we were not able to make the client-generated table render consistently in Netscape.
Below are the client-side issues we ran into.
- Empty table cells were not rendered in Netscape, even if the cell has a width and height specified.
This was easy to work-around by inserting a transparent gif. Even though this slightly defeats our goal
of avoiding images, the size of single pixel transparent gif (47 bytes) is extremely small and is cached and reused by each rule.
- We could not write a rule into a table. This is a known issue with Netscape Navigator which unfortunately
greatly limits the usefulness of the rule. A known work-around is to output the entire table using document.write's
through script but that seemed to extreme for common usage.
- The size of vertical rules were not correctly honored in tables. We use this to create a color-graded border around a table.
In the second page, where we listed the table of arguments, In Internet Explorer, we actually created a border around the entire table.
In Netscape, since the left and right borders do not render the correct height, we have chosen not to create them.
- The rules sometime fell apart when the screen was resized. This is a known issue in Navigator 4.0 with absolute positioning.
Apparently, this also applies to tables output through script. A work-around is to force the page to reload each
time the window resizes. You can learn more about this in our Creating Paged Documents article.
- The last issue is the one we cannot figure out. Sometimes Navigator failed to render the page following the rule. This appears
to happen randomly on our test machine, especially if the rule's alignment is set to left or right.
These are the issues we found when trying to run the code on the client. If you have any suggestions on how
to work around these problems, let us know in the client discussion forum.
Next, we discuss how we moved the code to the server. It is much easier than you may expect.
© 1997-2000 InsideDHTML.com, LLC. All rights reserved. |