Socket
Book a DemoInstallSign in
Socket

table-tag-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

table-tag-parser

parse `<table>` data

unpublished
latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

table-tag-parser

<table> tag to data.

Install

$ npm install table-tag-parser --save

Usage

<table id="table">
  <thead>
    <tr><th>h1</th><th>h2</th></tr>
  </thead>
  <tbody>
    <tr><td>data1</td><td>data2</td></tr>
    <tr><td>data2-1</td><td>data2-2</td></tr>
  </tbody>
  <tfoot>
    <tr><td>f1</td><td>f2</td></tr>
  </tfoot>
</table>
import parser from 'table-tag-parser';

const data = parser('#table');
// => [['h1', 'h2'], ['data1', 'data2'], ['data2-1', 'data2-2'], ['f1', 'f2']]

const data = parser('#table', { ignoreHeader: true, ignoreFooter: true});
// => [['data1', 'data2'], ['data2-1', 'data2-2']]

// parse from HTMLElement
const table = document.querySelector('#table');
const data = parser(table);
// => [['h1', 'h2'], ['data1', 'data2'], ['data2-1', 'data2-2'], ['f1', 'f2']]

Test

$ npm test

License

MIT

Keywords

table

FAQs

Package last updated on 03 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts