Sam-I-Am's Builder Blog

Work type stuff - handy urls and notes on the trials and tribulations of a web builder.

Thursday, May 26, 2005

Test case for TBODY/THEAD/TFOOT with overflow

I happenned across this test page while looking into scrollable table implementations: HTML Test Suite for UAAG 1.0 (Draft). I demonstrates how it ought to be done: you assign overflow: auto and a fixed height to the table's tbody, and you're done. Sigh.. if only it was that easy. The test does work in my Firefox 1.0.3, but then there's the horizontal scrollbar. If you add in a 16px scrollbar, you just hid 16px therefore a horizontal scrollbar is necessary to scroll over to see it. Makes perfect sense but its maddenning, because as of this writing I'm unable to remove the need for it. There are other ways to get there of course, but it want this one to work! For the record, border-collapse: collapse throws a spanner in the works in mozilla + cousins. Here's that illustrated: 1, 2.

Thursday, May 05, 2005

Perl Design Patterns Wiki

There's a world of goodness over at the perl design patterns wiki. Take this little snippet:

foreach my $i (qw(name price quantity)) {
    my $field = $i;
    *{"get_$field"} = sub {
      my $me = shift;
      return $me->{$field};
    *{"set_$field"} = sub {
      my $me = shift;
      @_ or die "not enough arguments to set_$field, stopped";
      $me->{$field} = shift;
      return 1;

..All your getters and setters, done. I'm in awe, and I'm dumping php and going back to perl :) This and other wisdom comes from the AccessorPattern page.