Comments (2)
I could use this as well.
from console-table-printer.
In relase 1.2.1 this feature is included.
Here is a sample code how you can do this:
const t = new Table({
style: 'fatBorder', //style of border of the table
columns: [
{ name: 'column1', alignment: 'left', color: 'red' }, //with alignment and color
{ name: 'column2', alignment: 'right' },
{ name: 'column3' },
],
});
t.addRow({ column1: 1, column2: 'red wine', column3: 10.212 });
t.addRow({ column1: 2, column2: 'red wine', column3: 10.212 });
t.addRow({ column1: 3, column2: 'red wine', column3: 10.212 });
t.printTable();
In case you have color mentioned in both column and row, column color will be prioritized.
from console-table-printer.
Related Issues (20)
- Error: Invalid count value when no rows HOT 5
- Render raw string HOT 5
- Horizontal and vertical lines are colored differently HOT 13
- unicode breaks alignment HOT 3
- Emoji charLength when combining with text HOT 2
- Text wrap as option
- newlines in cells produce newlines in table HOT 2
- Order of columns? HOT 3
- [feature] reset, empty rows HOT 6
- [feature] new colors (orange) HOT 2
- Crimson color doesn't apply to the table HOT 2
- Feature Request: Easy method for disabling color output HOT 11
- Suggestion: More header options, data options HOT 1
- Documentation request: Is the index property required? HOT 4
- Suggestion: add a divider option so can separate different rows HOT 1
- Documentation and/or Feature Request: Make it easier to learn how to create a "Row Number" column
- Bug: `table.addColumn` and `table.addColumns` have incorrect type signatures.
- Feature Request: narrow `any` types in typescript files HOT 1
- Doc to be updated
- Alignment has no effect (v2.12.0) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from console-table-printer.