neo-blessed/test/widget-table.js

40 lines
607 B
JavaScript
Raw Normal View History

var blessed = require('../')
, screen;
screen = blessed.screen({
dump: __dirname + '/logs/table.log',
autoPadding: true
});
var table = blessed.table({
parent: screen,
top: 'center',
left: 'center',
data: null,
border: 'line',
style: {
border: {
fg: 'red'
},
header: {
fg: 'blue',
bold: true
},
cell: {
fg: 'magenta'
}
}
});
table.setData([
[ 'Animals', 'Foods', 'Times' ],
[ 'Elephant', 'Apple', '1:00am' ],
[ 'Bird', 'Orange', '2:15pm' ]
]);
screen.key('q', function() {
return process.exit(0);
});
screen.render();