Permalink
Browse files

Do not encounter header widths in print()

  • Loading branch information...
1 parent 3d404bc commit 8ab83149790503566916022b3c492660b235b9b3 @eldargab committed Jul 25, 2012
Showing with 5 additions and 4 deletions.
  1. +0 −4 lib/table.js
  2. +5 −0 test/table.js
View
@@ -80,10 +80,6 @@ function print (rows, columns, shift) {
}
function calcWidths () {
- for (var key in columns) {
- setWidth(key, key.length)
- }
-
rows.forEach(function (row) {
for (var key in columns) {
setWidth(key, cellPrinter(row, key).call(row, row[key]).length)
View
@@ -28,6 +28,11 @@ describe('Easy table', function () {
'11 ' + t.shift + '12 ' + '\n' +
'21 ' + t.shift + '22 ' + '\n'
)
+
+ t.print().should.equal(
+ '11' + t.shift + '12\n' +
+ '21' + t.shift + '22\n'
+ )
})
it('Printing transposed version', function () {

0 comments on commit 8ab8314

Please sign in to comment.