Tags:
create new tag
view all tags
Here is a small change proposal. How about having Twiki render any table borders, even if the cell is empty.

Background:

At my work, I have a number of users who use tables a lot, but the tables start out empty for the most part. They like the borders to show, so they wind up entering “nbsp's” in every empty cell.

While the non-breaking-spaces solve the problem, I think it is cumbersome way to go about it.

Twiki::emitTR says:

sub emitTR {
    my ( $pre, $cells, $insideTABLE ) = @_;
    if( $insideTABLE ) {
        $cells = "$pre TR TD  $cells";
    } else {
        $cells = "$pre TABLE border=\"1\" TR TD  $cells";
    }
    $cells =~ s@\|\s*$@ /TD  /TR @go;
    $cells =~ s@\|@ TD TD @go;
    return $cells;
}
(removed tags for code display)

My understanding is that entering into the function, we need to replace $pre with an “nbsp” if $pre is empty. The most difficult part for me is in the last two lines before the return. Recursive substitution?? Anyone out there knows what to do here?

-- AlbertoBaez - 12 Jul 2001

This is in the latest TWikiAlphaRelease:

Cell to the right has a dot .
Cell to the right has  :  
Cell to the right has no space
Cell to the right has one space  
Cell to the right has two spaces  
Cell to the right has three spaces  

-- PeterThoeny - 15 Jul 2001

TopicClassification:
FeatureDone
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2001-07-15 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.