table flip columns
This function flips (i.e. mirrors) the columns in the table. Either all columns below the existing header row (widht of header applies), or a specified range from one column till another column can be flipped. The header row will also be flipped. You are allowed to specify columns beyond the existing table contents in order to move blank columns to the left.
Indirect parameter passing is disabled
1-3
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table The columns in this table will be flipped |
Opt. 2 input |
table columns | Starting column Flipping starts at this column.
|
Opt. 3 input |
table columns | Ending column Flipping ends at this column. No flips made if ending column is before the starting column.
|
table initialize( temps,
{ { City, Winter, Spring, Summer, Autumn },
{ Stockholm, -5, 5, 15, 10 },
{ Munich, 5, 10, 25, 15 },
{ Rome, 10, 20, 35, 25 },
{ Nairobi, 25, 25, 25, 25 } });
table list ( temps );
// Flip the seasons including 1 blank column to the right to add space
table flip columns ( temps, Winter, 5 );
echo("Columns flipped:");
table list ( temps );
0 : City | Winter | Spring | Summer | Autumn
1 : Stockholm | -5 | 5 | 15 | 10
2 : Munich | 5 | 10 | 25 | 15
3 : Rome | 10 | 20 | 35 | 25
4 : Nairobi | 25 | 25 | 25 | 25
Columns flipped:
0 : City | | Autumn | Summer | Spring | Winter
1 : Stockholm | | 10 | 15 | 5 | -5
2 : Munich | | 15 | 25 | 10 | 5
3 : Rome | | 25 | 35 | 20 | 10
4 : Nairobi | | 25 | 25 | 25 | 25