"mzanime.com" <webforumsuser (AT) macromedia (DOT) com> wrote
Quote:
I'm creating a template specifically for large data tables so the header
and
footer are just two small included tables containing text. But I want the
header and footer to be aligned "default" for users with 600x800
resolution and
aligned to the "center" for users with 1024x768 and higher. |
What, exactly, do you think that screen resolution has to do with anything?
I use machines with 1024x768 and 1280x1024, but I rarely have a browser
window wider than 800.
Quote:
I tried writing this little bit of JS, and it works but both Dreamweaver
and
the W3C says that its bad coding. :-) |
It is bad coding. Relying on screen resolution to lay out the page is a
flawed approach and will not give good results in many cases. However, if
all you want is for this bad code to validate, add the two lines below:
Quote:
script language="JavaScript" type="text/javascript" |
//<![CDATA[
Quote:
if (window.screen.width>=1024) { document.write("<table border='0'
cellpadding='0' cellspacing='0' align='center' width='750'>");
} else if (window.screen.width>=800) { document.write("<table border='0'
cellpadding='0' cellspacing='0' width='750'>");} |
//]]>
Gary