vroom has asked for the wisdom of the Perl Monks concerning the following question:

Ok so maybe this is slightly off topic but what the heck. Does anyone know how you can place layers within tables. I've used ILAYER semi-successfully but as soon as I the table gets too complex unexpected things start happening. If I have nested tables things no longer work as expected. Could anybody offer any help or point out any gotchas that might be hanging me up??? Thanks

Updated:

test1.html contains ilayer source document ------------------------------------------ <HTML><BODY bgcolor="FF0000"></BODY></HTML> test2.html calls the ilayer this doesn't work... if you take away the outer table it works or if you take away the ilayer in the middle it works ------------------------------------------------ <HTML><BODY bgcolor=ffffff> <TABLE><TR><TD bgcolor=AAAAAA> Yeah <TABLE><TR><TD bgcolor=0000FF> Blah </TD> <TD> <ILAYER src=test1.html width="500" height="100"></ILAYER> </TD> <TD bgcolor=00FF00>Still more stuff</TD> </TR></TABLE> Stuff </TD></TR></TABLE> </BODY></HTML>

Replies are listed 'Best First'.
RE: Layers within tables
by neshura (Chaplain) on May 09, 2000 at 00:20 UTC
    Right off hand, I can't say without seeing some code. Why don't you post a snippet that's not working as expected? Updated:

    I am not seeing any problems using N4.7 on NT. IE 4.0 and N6 PR1 are another story -- the code totally doesn't work. From what I can see, your test case is trying to build an outer table with a grey background. The nested table has a green cell, a cell containing a red inlined layer, and a blue cell.

    Well, I played around with your code, added some more layers, an ode to hunger, and some table attributes. They work absolutely fine -- but only in N4.7.

    restating common knowledge... Layer behavior is browser specific which requires that you use *groan* javascript to autodetect and write the correct tags if you are coding for a general audience. I don't know if IE 5 supports external doc loading for layers but I know that 4.0 does not. LAYER and ILAYER usually work as expected under Netscape (pour moi), so I am unable to guess where your errors are coming from... (Netscape under Linux? Some other weird and kray-Z browser/OS combo?)

    e-mail neshura

Re: Layers within tables
by johncoswell (Acolyte) on May 09, 2000 at 02:45 UTC
    Check out DynAPI. It's a bunch of JavaScript code that you cut & paste or include into your pages that will handle layers & other DHTML widgets in Netscape and IE. And it's GPL! I might give it a go on my site, too. Hope this helps.

    John Coswell - http://www.coswell.com

      Hi,

      Want to add a problem to that DynAPI.

      It's not platform-independent!!

      Ugly/not working on Mac/linux.
      Well some things work a believe but not all and I feel(also in programming perl) that it should try to be platform-independent.
      Don't know how you all feel. Maybe some reactions??

      UPDATE:
      ILAYER is a tag that is not used anymore. The best to use is to use div and css. And be on the watch it works on all platforms.
      Working with layers is something that should be avoided becauce they're the main raison why websites don't look the same or are viewable by all platforms!!
Re: Layers within tables
by Russ (Deacon) on May 09, 2000 at 02:15 UTC

    After crashing Netscrape (4.07), the next time I tried it, it worked just fine.

    My question for you: why are you using an ilayer? I assume you are intending to do DHTML stuff with it... If not, just use <div> or <span> to get your W3C-compliant attributes set.

    I am currently involved in a HEAVILY DHTML-ized website for a promotional materials/printing company in Fort Smith, AR. Having dealt wit DHTML in Netscrape and Exploder, I have to say, "I hate Netscape!" Exploder has its problems, but for DHTML it is basically just downright nice... Standardization will help tremendously, of course.

    Anyway, back to the issue at hand...;-)
    "Layers in tables" has always been a shaky proposition, at best, in Netscrape. Our experience says you *must* use <layer> (or <ilayer>) calls to have any hope of it working, and even then, good luck.

    Russ
Re: Layers within tables
by Russ (Deacon) on May 09, 2000 at 02:13 UTC

    After crashing Netscrape (4.07), the next time I tried it, it worked just fine.

    My question for you: why are you using an ilayer? I assume you are intending to do DHTML stuff with it... If not, just use

    or to get your W3C-compliant attributes set.

    I am currently involved in a HEAVILY DHTML-ized website for a promotional materials/printing company in Fort Smith, AR. Having dealt wit DHTML in Netscrape and Exploder, I have to say, "I hate Netscape!" Exploder has its problems, but for DHTML it is basically just downright nice... Standardization will help tremendously, of course.

    Anyway, back to the issue at hand...;-)
    "Layers in tables" has always been a shaky proposition, at best, in Netscrape. Our experience says you *must* use <layer> (or <ilayer>) calls to have any hope of it working, and even then, good luck.

    Russ
      Argh! I missed a couple conversions of <'s and >'s.

      Kindly remove, please?

      It's hosed enough to prevent me from editing it myself :-(

      Thanks,
      Russ
RE: Layers within tables
by Anonymous Monk on May 09, 2000 at 13:34 UTC
    Nest the layer inside a DIV like so:
    <layer name="alayer" pageX="100" pageY="110"> some code </layer>
    Tables suck. Use CSS-P instead.
Re: Layers within tables
by mr_ayo (Beadle) on May 09, 2000 at 01:49 UTC
    This seems to depend on the browser.
    Using Netscape 4.08 your example rendered just fine with both tables in place.
    Using IE 5.5 the example choked even with only one table.
    Using IE 5 the example worked fine.
    Sounds like you need to find something a little more reliable.