Name

removeColumn()

Class

Table

Description

Use removeColumn() to remove an existing column from a Table object. The column to be removed may be identified by either its title (a String) or its index value (an int). removeColumn(0) would remove the first column, removeColumn(1) would remove the second column, and so on.

Examples

  • Table table;
    
    void setup() {
    
      table = new Table();
      
      table.addColumn("id");
      table.addColumn("species");
      table.addColumn("name");
      println(table.getColumnCount());  //Prints 3
      
      table.removeColumn("id");         //Reference by title
      println(table.getColumnCount());  //Prints 2
    }
    
  • Table table;
    
    void setup() {
    
      table = new Table();
      
      table.addColumn("id");
      table.addColumn("species");
      table.addColumn("name");
      println(table.getColumnCount());  //Prints 3
      
      table.removeColumn(0);            //Reference by ID
      println(table.getColumnCount());  //Prints 2
    }
    

Syntax

  • .removeColumn(columnName)
  • .removeColumn(column)

Parameters

  • columnName(String)the title of the column to be removed
  • column(int)the index number of the column to be removed

Return

  • void