After installing the 01 Sept 2001 version, I noticed that the format of the supplied
TWikiWebsTable looked different. I saw that border= and BGcolor= etc changed the look of the hardcoded table. I wanted to make all my TWiki topic contained tables look like that too, so I found in TWiki.pm sub emitTR where this is done. Alas, it looked OK with my MSIE but Netscape didn't render it quite right. I found that I needed border=1 to look OK with Netscape and Border=0 for MSIE. The following code snippet is what I came up with:
sub emitTR {
my ( $thePre, $theRow, $insideTABLE ) = @_;
my $text = "";
my $attr = "";
my $l1 = 0;
my $l2 = 0;
my $bord = 0;
if( $insideTABLE ) {
# DNM add bgcolor
$text = "$thePre<tr bgcolor=\"#ffffff\">";
} else {
# DNM add bgcolor and change border and spacing
# DNM check for MSIE and set border accordingly. IE looks OK with
# border 0, Netscape needs atleast 1
if ( ! ( $ENV{HTTP_USER_AGENT} =~ /MSIE/g) ) {
$bord = 1;
} else {
$bord = 0;
}
$text = "$thePre<table border=\"$bord\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#000000\"> <tr bgcolor=\"#ffffff\">";
}
$theRow =~ s/\t/ /go; # change tabs to space
$theRow =~ s/\s*$//o; # remove trailing spaces
Does this seem useful to anyone else?
--
DanaMitchell - 20 Nov 2001