Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

rowSpan on first two columns causes extra cells on the right #21

Open
sthadeshwar opened this issue Jun 7, 2016 · 3 comments
Open

rowSpan on first two columns causes extra cells on the right #21

sthadeshwar opened this issue Jun 7, 2016 · 3 comments

Comments

@sthadeshwar
Copy link
Contributor

Does the code below look correct? If yes, then seems like this could be a bug in cli-table2.

var Table = require('cli-table2');

var table = new Table({
    head: ['COL1', 'COL2', 'COL3', 'COL4'],
    colWidths: [25, 40, 30, 30],
    style: { head: ['green'], compact : false }
});
table.push([ { rowSpan: 3, content: 'r1c1' }, { rowSpan: 3, content: 'r1c2' }, 'r1c3', 'r1c4']);
table.push([ 'r2c3', 'r2c4']);
table.push([ 'r3c3', 'r3c4']);
console.log(table.toString());

The resulting table looks like this (Notice the two cells on the right at 3rd and 4th rows):


┌──────┬──────┬──────┬──────┐
│ COL1 │ COL2 │ COL3 │ COL4 │
├──────┼──────┼──────┼──────┤
│ r1c1 │ r1c2 │ r1c3 │ r1c4 │
│      │      ├──────├──────┼──────┤
│      │      │ r2c3 │ r2c4 │      │
│      │      ├──────├──────┤      │
│      │      │ r3c3 │ r3c4 │      │
└──────┴─────┴─────┴─────┴──────┘

@jamestalmage
Copy link
Owner

Definitely a bug

@sthadeshwar
Copy link
Contributor Author

@jamestalmage Do you think you would be able to get to it any time soon? Just so that, if it soon, then I won't hack something in my code to achieve similar results with cli-table.

@jamestalmage
Copy link
Owner

I don't know how soon I will be able to. If you need it urgently, PR's are always welcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants