custom-table-name-former-css v1.0.4
TableFormer (NPM Package).
Introduction.
This Package include a library that can used to generate CSS/Boostrap formatted HTML tables.
Installation.
npm install custom-table-name-former-css
Requirements.
You can link the HTML file with boostrap.css file to get the view.
Syntax and Usage.
const TableFormer = require("custom-table-name-former-css")
Available methods in TableFormer npmTesting.TableFormer.acceptArray(nums)
Method will return onject tyep of TableFormer. ThreadOur class consist of
.init()
-> return thread count in String format. This is a private method accept(row, columns, type)
row ->
number of rows should be in the table.columns ->
number of columns should be in the table.type ->
html/css type of the table.
.setHeadings()
-> return thread count in String format. This method accept an string array with same number of elements as width of number of columns.
.log()
-> Generate the table and return a string value of the complete HTML.
Example Usage.
var htmlContent = "";
//Importing the testing package
const tableFormer = require("custom-table-name-former-css")
//Input Array.
let nums = [5,5,"css"];
//Sample Heading Values.
let heading = ["head1", "head2", "head3", "head4", "head5"];
//Input the array and initiate table object
let object = tableFormer.TableFormer.acceptArray(nums);
//Pass Heading parameters to the table.
object.setHeadings(heading);
//Generate the table and store in a variable.
htmlContent = object.log();
Extra.
create a HTML file from the string.
const fs = require('fs');
fs.writeFile(__dirname + '/table.html', htmlContent, (error) => { console.log("Error") });
Keywords.
JS
Library
Generate Tables
Modules
Package
Dependancies