Re: JavaScript in table tags

by "Hilma" <Hilma(at)hilma.freeserve.co.uk>

 Date:  Tue, 2 Apr 2002 13:17:28 +0100
 To:  <hwg-basics(at)hwg.org>,
"Andrew McFarland" <aamcf(at)aamcf.co.uk>
 References:  ntlworld
  todo: View Thread, Original
Many thanks for that :-)


> >when i try to validate my code,  it tells me that i cannot have <script>
> >tags within my <table> definition.
>
> You can put a <script> within a td or th, but not directly within any
other
> table elements (see http://aamcf.co.uk/html/transitional/script.html). [1]
>

So i;ve since found out;
 i thought that was what i was doing in the first place; but it wasn't :-(
I'd started at <tr> levt, not <td> so got confused (wrong!) about what was
and what was not allowed.

However; it works now as i want (except i can;t format it correctly, i hate
the format; but i cannot put "cellpadding" into a cell, only a table, and i
can;t figure out how to make it look nice; hence borders showing on

http://mysite.freeserve.com/bbm/PressGang6/PGPrices6.html

I don't really want more nested tables, but how else do i get the text
left-justified but a little out from the LH borders, keep the NavPanel as it
is, and the tables sitting next to each other ?
I;ve read up about table  borders, cellspacing and cellpadding; I went
"cellpadding" as an attribute of <td>, but it isn't :-(

> I'm not sure that JavaScript is the correct solution to the problem
though.
> The information you are writing with the JavaScript isn't going to change
> very often (is it?) so it might be better to write it as a plain vanilla
> static HTML page. This would certainly make the whole thing simpler for
the
> end user, and it would probably be more future proof as well (and it would
> have better sideways and backwards compatibility).

True; i have had "plain html", "Server-side calcs" and "image" suggested to
me;
but it is mainly a learning exercise for me; it's my first site and i'm
trying
to get a year's experience in 2 months, ready for a 2nd-year Web design
course i start in May :-0
 - hence my preference to work out how to get a JS table into the contents
page, rather than alternatives because of what the content is;
As far as this specific example is concerned, you're right; but as an
exercise to learn the techniques, it worked fine.

So when i get a problem, I like and want *both* the answer to me specific
problem,
*and* recommendations for "but it would be better to....."

So many thanks for your suggestion :-)

I really do appreciate all this help!

hilma
--x---




>
> Andrew
>
> --
> http://aamcf.co.uk/
>
> [1] See http://aamcf.co.uk/html/ for reference material on XHTML 1.0 that
> was generated from the DTDs by perl. Its quite handy, and comes in an easy
> to download zip version as well.
>
>

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA