my $maxRows = $tableMatrix->cget( -rows ); my $maxCols = $tableMatrix->cget( -cols ); for my $r ( 1 .. $maxRows -1 ) { set $maxHeight = 1; for my $col ( 0 .. $maxCols - 1 ) { my $text = $tableMatrix->getText( -row => $row, -col => $col ); my $nLines = scalar split "\n", $text; if( $nLines > 1 and $maxHeight < $nLines ) { $maxHeight = $nLines; } } $tableMatrix->cset( row => $row, height => $maxHeight ); }