vamtiger-get-string-table
v0.0.7
Published
Get a string table for a defined table object
Downloads
455
Maintainers
Readme
VAMTIGER Get String Table
VAMTIGER Get String Table will return a string for a defined tabular data.
Installation
VAMTIGER Get String Table can be installed using npm or yarn:
npm i --save vamtiger-get-string-table
or
yarn add vamtiger-get-string-table
Usage
Import or require a referece to VAMTIGER Get String Table:
import getStringTable from 'vamtiger-get-string-table';
or
const getStringTable = require('vamtiger-get-string-table').default;
A representative string table can be reference for structured tabular data.
const someTabularData = {
// Optional, but recommended
header: ['Column 1', 'Column 1', 'Column 1'],
body: [
['Value 1', 'Value 1', 'Value 1'],
['Value 1', 'Value 1', 'Value 1'],
['Value 1', 'Value 1', 'Value 1']
]
}
const stringTable = getStringTable(someTabularData);
/*
==================================
| Column 1 | Column 2 | Column 3 |
==================================
| Value 1 | Value 2 | Value 3 |
----------------------------------
| Value 1 | Value 2 | Value 3 |
----------------------------------
| Value 1 | Value 2 | Value 3 |
----------------------------------
*/
Table markers can be hidden, by setting the hideMarker option to true.
const someTabularData = {
// Optional, but recommended
header: ['Column 1', 'Column 1', 'Column 1'],
body: [
['Value 1', 'Value 1', 'Value 1'],
['Value 1', 'Value 1', 'Value 1'],
['Value 1', 'Value 1', 'Value 1']
],
hideMarker: true
}
const stringTable = getStringTable(someTabularData);
/*
Column 1 Column 2 Column 3
Value 1 Value 2 Value 3
Value 1 Value 2 Value 3
Value 1 Value 2 Value 3
*/