cli-table2 icon indicating copy to clipboard operation
cli-table2 copied to clipboard

Character align?

Open TuckerWhitehouse opened this issue 11 years ago • 3 comments

Would it be possible to add support for alignment by character? Something similar to the "dotted"-align found in https://npmjs.com/package/text-table but more generic.

I've got source line and column information that I would like to display as colon separated. I believe a use case similar to mine can be seen here https://github.com/feross/snazzy.

TuckerWhitehouse avatar Jul 29 '15 16:07 TuckerWhitehouse

I'm not sure what you're asking for. Do you want just no outline?

https://github.com/jamestalmage/cli-table2#custom-styles

jamestalmage avatar Jul 29 '15 21:07 jamestalmage

I'm looking for the contents of a column to be aligned based on a character in that string. text-table offers a "dotted" alignment where a column's values are all aligned based on the "." (such as numbers) https://www.npmjs.com/package/text-table#dotted-align

See how the contents of the first column are aligned by the ":"?
┌────────────────────────────────────────────────┐
│ /Users/Tucker/Project/js/main.js               │
├──────────┬───────┬─────────────────────────────┤
│    2:0   │ error │ There was some error        │
├──────────┼───────┼─────────────────────────────┤
│ 3864:12  │ error │ There was some extremely    │
│          │       │ long and detailed error     │
├──────────┼───────┼─────────────────────────────┤
│    2:10  │ alert │ Alert found!                │
├──────────┼───────┼─────────────────────────────┤
│   32:0   │       │ Nothing to see here         │
└──────────┴───────┴─────────────────────────────┘

TuckerWhitehouse avatar Jul 29 '15 23:07 TuckerWhitehouse

Ah, I get it. Yes, good feature request.

jamestalmage avatar Jul 30 '15 00:07 jamestalmage