You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.addRow({ Weight:3, text:"rosa hemd wie immer", value:100 });
67
67
p.printTable();
68
68
```
69
+
70
+
## Clearing Rows
71
+
72
+
Use `clearRows()` when you want to remove the current row data and reuse the same table instance. The table keeps its columns and configuration, so you can add fresh rows without rebuilding the table.
73
+
74
+
`clearRows()` returns the table instance, so it can be used in a method chain.
75
+
76
+
```javascript
77
+
import { Table } from'console-table-printer';
78
+
79
+
constp=newTable(["id", "status"])
80
+
.addRows([
81
+
{ id:1, status:"Queued" },
82
+
{ id:2, status:"Running" },
83
+
])
84
+
.clearRows()
85
+
.addRows([{ id:3, status:"Done" }]);
86
+
87
+
p.printTable();
88
+
```
89
+
90
+
Rows added during table creation can also be cleared.
0 commit comments