Opened 3 years ago

Closed 3 years ago

# Accept rows with missing columns

Reported by: Owned by: anonymous jonny normal TablePlugin normal 1.3

### Description

I made a small hack to make TablePlugin accept rows that don't contain all columns.

This is a correct syntax, without my fix:

{{{
#!styledtable
@table (@default)

@column details
@column status

@details: Details
@status: Status

#! Rows
@status: Complete

@status: Complete
}}}



However, if one were to leave out (by mistake or choice) a column somewhere, an unclear error message would show instead.

So I adjusted the code to allow for missing columns, which makes the missing cell just show up as empty. To make this work one needs to add  @endrow  to end of row. If one doesn't do that, the plugin works just as before, it's backward compatible. This means that if one have a lot of columns, where many cells in rows are empty, it will be drastically shorter to work with the syntax for it.

With my adjustment, this is working just fine:

{{{
#!styledtable
@table (@default)

@column details
@column status

@details: Details
@status: Status

#! Rows
@status: Complete

@endrow
}}}


I haven't got the first clue on how to use SVN, I hope it's ok to just attach my modified code to this ticket and hopefully @rjollos will consider and possibly act on it.

(Sidenote: I'm using this with Trac 1.3.6 so I can confirm that this version (and the one already published) works fine.)

Updated table.py

### comment:1 in reply to:  description Changed 3 years ago by Ryan J Ollos

I haven't got the first clue on how to use SVN,

$svn co ...$ ed ...
\$ svn diff > patch


### comment:2 Changed 3 years ago by Ryan J Ollos

Resolution: → fixed new → closed

In 17473:

Interpolate row with empty cells when @endrow encountered

Fixes #13597.

### comment:3 Changed 3 years ago by Ryan J Ollos

Please document on the TablePlugin page.

### comment:4 Changed 3 years ago by anonymous

Please document on the TablePlugin page.

Done. And thank you for acting on this...

See ​TracDev/SubmittingPatches.

...and thank you for showing that page, I had completely missed it.

### Modify Ticket

Change Properties