Automatically Removing NET From a Table
Jump to navigation
Jump to search
Deletes the NET column and row from tables (if they exist). Does not delete any nets that have been manually created or renamed (i.e., it works by looking for the word 'NET').
includeWeb("Table JavaScript Utility Functions");
// Delete any NET columns
var n_deleted_cols = 0;
table.netColumns.forEach(function (net_col) {
deleteColumnComplete(net_col - n_deleted_cols);
n_deleted_cols++;
});
// Delete any NET rows
var n_deleted_rows = 0;
table.netRows.forEach(function (net_row) {
deleteRowComplete(net_row - n_deleted_rows);
n_deleted_rows++;
});
Note that the code above also removes the NET from below_table and right_table, which correspond to the tables for the Statistics - Below and Statistics - Right respectively. These tables must be addressed separately - they do not automatically update when the main table is changed. The two functions deleteColumnComplete() and deleteRowComplete() can be used to address the extra tables automatically whenever they are shown on the table.
See also
- Table JavaScript and Plot JavaScript for an explanation of how to run this code.
- Table JavaScript and Plot JavaScript Reference for technical information.
- Table JavaScript and Plot JavaScript Examples Library for other examples.
- JavaScript for information about the JavaScript programming language.
- QScript for tools for automating projects using JavaScript.
- JavaScript Variables for detail on how to create new variables in the Variables and Questions tab using JavaScript.