cheerio-tableparser
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "cheerio-tableparser", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "table parser plugin for cheerio", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -36,9 +36,9 @@ # cheerio-tableparser | ||
## Features | ||
__Easy to use:__ | ||
You just need cheerio and cheerio-tablerparser to parse complex tables. As easy as JSON.parse(). You get array of columns. | ||
⏎ __Easy to use:__ | ||
You just need cheerio and cheerio-tablerparser to parse complex tables, as easy as JSON.parse(). You get array of columns. | ||
__Configurable:__ | ||
Cheerio-tableparser can duplicate empty cells in rows or coloumns or even both. Result can be text or html. | ||
⚙ __Configurable:__ | ||
Cheerio-tableparser can duplicate empty cells in rows or columns or even both. Result can be text or html. | ||
__Fast:__ | ||
ϟ __Fast:__ | ||
As fast as cheerio is. | ||
@@ -48,3 +48,3 @@ | ||
Cheerio-tableparser used only for tables created with “table” tag. In other unusual situations you should use other solutions. For example css or div formated text looks like table is not affordable. | ||
Cheerio-tableparser used only for tables created with “table” tag. In other unusual situations you should use other solutions. For example css formated text looks like table is not affordable. | ||
@@ -70,17 +70,16 @@ ## How it works | ||
### Example table: | ||
``` | ||
|-------------------| | ||
| A | B | C | D | E | | ||
|-------------------| | ||
| | 2 | 3 | 4 | 5 | | ||
| |---------------| | ||
| | | 4b| 5b| | ||
| | 2b |-------| | ||
| 1 | | | 5c| | ||
| |-------| 4c|---| | ||
| | | 3d| | 5d| | ||
| | 2d|-----------| | ||
| | | 3e| 4e| 5e| | ||
|-------------------| | ||
``` | ||
|-------------------| | ||
| A | B | C | D | E | | ||
|-------------------| | ||
| | 2 | 3 | 4 | 5 | | ||
| |---------------| | ||
| | | 4b| 5b| | ||
| | 2b |-------| | ||
| 1 | | | 5c| | ||
| |-------| 4c|---| | ||
| | | 3d| | 5d| | ||
| | 2d|-----------| | ||
| | | 3e| 4e| 5e| | ||
|-------------------| | ||
#### Load data and add plugin | ||
@@ -102,2 +101,14 @@ ```js | ||
#### Copy empty cells from data in columns | ||
```js | ||
var data = $("#complex").parsetable(false, true, false); | ||
//data = > | ||
//[ [ 'A', '1', '1', '1', '1', '1' ], | ||
// [ 'B', '2', '2b', '2b', '2d', '2d' ], | ||
// [ 'C', '3', '', '', '3d', '3e' ], | ||
// [ 'D', '4', '4b', '4c', '4c', '4e' ], | ||
// [ 'E', '5', '5b', '5c', '5d', '5e' ] ] | ||
``` | ||
#### Copy empty cells from data in rows | ||
@@ -115,14 +126,2 @@ | ||
#### Copy empty cells from data in columns | ||
```js | ||
var data = $("#complex").parsetable(false, true, false); | ||
//data = > | ||
//[ [ 'A', '1', '1', '1', '1', '1' ], | ||
// [ 'B', '2', '2b', '2b', '2d', '2d' ], | ||
// [ 'C', '3', '', '', '3d', '3e' ], | ||
// [ 'D', '4', '4b', '4c', '4c', '4e' ], | ||
// [ 'E', '5', '5b', '5c', '5d', '5e' ] ] | ||
``` | ||
#### Copy empty cells from data in rows AND columns | ||
@@ -151,10 +150,10 @@ | ||
### Example HTML table: | ||
``` | ||
|-------------------------------------------------------------------| | ||
| <strong>A</strong> | <strong>B</strong> | | ||
|-------------------------------------------------------------------| | ||
| <div class='table-text'>1</div> | <div class='table-text'>2</div> | | ||
|-------------------------------------------------------------------| | ||
``` | ||
|-------------------------------------------------------------------| | ||
| <strong>A</strong> | <strong>B</strong> | | ||
|-------------------------------------------------------------------| | ||
| <div class='table-text'>1</div> | <div class='table-text'>2</div> | | ||
|-------------------------------------------------------------------| | ||
#### Load data and add plugin | ||
@@ -161,0 +160,0 @@ ```js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10286
205