1.0.1 • Published 1 year ago

east-html-tables v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

EasyTable

EasyTable is a Node.js package for easily formatting HTML tables with predefined styles.

Installation

npm install easy-html-tables

Usage

const EasyTable = require('easy-html-tables');

const html = `
    <table>
        <tr>
            <th>Header 1</th>
            <th>Header 2</th>
        </tr>
        <tr>
            <td>Data 1</td>
            <td>Data 2</td>
        </tr>
    </table>
`;

const easyTable = new EasyTable(html);
const formattedTable = easyTable.generate();
console.log(formattedTable);

Custom Styles

You can pass custom styles as an option:

const customStyles = {
	table: { border: '2px solid blue' },
	th: { 'background-color': 'gray' },
	td: { 'font-style': 'italic' },
};

const easyTable = new EasyTable(html, { styles: customStyles });
const formattedTable = easyTable.generate();
console.log(formattedTable);

Contributing

Please open an issue or submit a pull request for any enhancements or bugs.

EasyTable

1.0.1

1 year ago

1.0.0

1 year ago