table rearrange columns, table rearrange existing columns
This function rearranges and rearranges the columns specified according to the order provided in the 2nd function parameter. All remaining columns will be deleted.
Indirect parameter passing is disabled
2
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
2 input |
table columns | Existing columns See table columns as function parameters for general ruling for this parameter.
|
Table not found
Header name not found
table initialize ( table, { { First Name, "Middle Init.", Last Name, "Street", "Town" },
{ Jane, "E.", Archer, "1. Main St.", "Miami", "Comments" } } );
echo("Original table: ", table max width(table), " columns. __________________ ");
table list( table );
table copy table (table, t1 );
table rearrange columns(t1, { 2, First Name, -1 }); // Last Name, First Name, Town
echo("Names only: ", table max width(t1), " columns. __________________ ");
table list( t1 );
table copy table (table, t1 );
table rearrange existing columns(t1, { 5, 2, First Name, Phone }); // Comments column, last name, first name, No phone Nr.
echo("Names only: ", table max width(t1), " columns. __________________ ");
table list( t1 );
Original table: 6 columns. __________________
0 : First Name | Middle Init. | Last Name | Street | Town |
1 : Jane | E. | Archer | 1. Main St. | Miami | Comments
Names only: 6 columns. __________________
0 : Last Name | First Name | Town | Middle Init. | Street |
1 : Archer | Jane | Miami | E. | 1. Main St. | Comments
Names only: 6 columns. __________________
0 : | Last Name | First Name | Middle Init. | Street | Town
1 : Comments | Archer | Jane | E. | 1. Main St. | Miami