terminal-table
Advanced tools
Comparing version 0.0.9 to 0.0.10
28
index.js
@@ -231,6 +231,32 @@ var eaw = require("eastasianwidth"); | ||
this.init(row, column); | ||
this.table[row][column].text = text; | ||
this.table[row][column].text = text + ""; | ||
}; | ||
Table.prototype.insertRow = function(rowIndex, items){ | ||
if(this.table[rowIndex]){ | ||
this.table.splice(rowIndex, 0, []); | ||
} | ||
for(var i = 0, l = items.length;i < l;i++){ | ||
this.cell(rowIndex, i, items[i] || ""); | ||
} | ||
}; | ||
Table.prototype.insertColumn = function(columnIndex, items){ | ||
var l = Math.max(this.table.length, items.length); | ||
for(var i = 0;i < l;i++){ | ||
if(!this.table[i]){ | ||
this.table[i] = []; | ||
} | ||
else{ | ||
this.table[i].splice(columnIndex, 0, ""); | ||
} | ||
if(items[i]){ | ||
this.cell(i, columnIndex, items[i]); | ||
} | ||
} | ||
}; | ||
Table.prototype.removeCell = function(row, column){ | ||
@@ -237,0 +263,0 @@ this.init(row, column); |
{ | ||
"name": "terminal-table", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "View a table in the terminal.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -70,2 +70,4 @@ terminal-table | ||
- cell(row, column, text) | ||
- insertRow(rowIndex, ["item", ...]) | ||
- insertColumn(columnIndex, ["item", ...]) | ||
- attr(row, column, { attrs }) | ||
@@ -72,0 +74,0 @@ - __attrs__ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51600
14
435
84