in reply to (OT) Use javascript? ahhh!!!

Not only is this not a Perl question, it's not really a JavaScript question either. It's an HTML design question, and trying to play that game with JavaScript is nothing short of foolish. Why not simply specify exact widths for the outter columns and make the middle column variable?
<tr> <td width="80">stuff</td> <td width="100%">stuff</td> <td width="200">stuff</td> </tr>
Also, you might want to consider using CSS instead, check out this example

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: (OT) Use javascript? ahhh!!!
by yosefm (Friar) on Jun 09, 2003 at 16:40 UTC
    Thanks, but that's not exactly what I meant. The question was about avoiding Javascript, if it's at-all possible.

    About no tables, this sounds interesting but I don't know if I'll have the time to learn that.

    Thanks anyway, guys...

      That answer will help you solve the problem. Define your cell widths and the rest will follow. Use percentage widths and if you absolutely must alter your HTML based on screen size then you'll need to use JavaScript to fetch it.

      A thought crossed my mind - would allowing the viewer to change the number of columns be a possibility? If so, you could use something like the following script:
      use strict; use warnings; use CGI qw(:standard); print header,start_html,start_form, p( 'How many columns? ', popup_menu(-name=>'cols',-values=>[1..16]), ), submit,end_form,hr, ; my $cols = param('cols') || 4; my @one_d = map sprintf('%02x',$_) x 3, reverse (0..255); my @two_d = map[ @one_d[$_..$_+$cols-1] ], range(0,$#one_d,$cols) ; print p("there are $cols columns:"), table( map {Tr( map {td{bgcolor=>"#$_"},$_} @$_ )} @two_d ), end_html, ; sub range {grep!(($_-$_[0])%($_[2]||1)),$_[0]..$_[1]}

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)