Re: JavaScript in table tags

by "Martin Clifford" <MLC1(at)nrc.gov>

 Date:  Mon, 01 Apr 2002 10:58:29 -0500
 To:  <Hilma(at)hilma.freeserve.co.uk>,
<hwg-basics(at)hwg.org>
  todo: View Thread, Original
Hi Hilma,

While I could not connect to your site for whatever reasons, I can =
visualize the layout of your page quite easily.  And you are right, it is =
the standard format (from what I've seen).

I'm not quite sure I understand what you are trying to accomplish with =
JavaScript, or why it would give you an error.  JavaScript can be placed =
anywhere in an HTML document and still function, unless you are trying to =
use event handlers inside the Table tags themselves, in which case you get =
errors because Tabel tags can't handle events.

Or are you just trying to strictly adhere to W3C standards, and in that =
mind-set, it is an error to put JavaScript inside Table tags?  I might be =
able to help if you could just clarify a bit. :o)

I'll be here for a while... 8am to 5pm... everyday.

Martin

>>> "Hilma" <Hilma(at)hilma.freeserve.co.uk> 04/01/02 09:32AM >>>
Having got my code working :-)
I decided to validate :-(

Most is getting sorted; but i have a problem with JS and tables.

I use tables to format my page:
 a row across the top spanning 2 columns for my header-logo,  (same in all
pages)
 a fixed-width column on the Left  for my nav-buttons, and       (same in
all pages)
 a wide column taking up the rest of the page for my content;    (different=
)

a format that i believe is fairly standard ("correct my if i'm wrong").

However;
for my "prices" page, i include another table within the content-cell;
and i fill that using Javascript that multiplies up incrementing weights =
by
unit cost.
This works fine; *but*
when i try to validate my code,  it tells me that i cannot have <script>
tags within my <table> definition.

I started moving the script out of the prices-table (putting the table
definition into the JS as
document.write("<table..> format)

But then i hit the fact that i was still within my main-table content-cell;=

which I cannot really climb out of as the whole page is covered by a =
single
table.

my code is now at:
http://mysite.freeserve.com/bbm/PressGang6/PGHome6.html=20

and it is the Prices page giving me grief.

(Errors after the script/table errors are all due to the Freeserve-inserted=

last line, which i can live with for now).



Many thanks for any help -

hilma
--x-----

HTML Guild: hwg-basics mailing list archives, maintained by Web Professionals @ IWA