An open API service indexing awesome lists of open source software.

https://github.com/transpect/htmltables

Replace colspan and rowspan with virtual cells
https://github.com/transpect/htmltables

html tables

Last synced: 4 months ago
JSON representation

Replace colspan and rowspan with virtual cells

Awesome Lists containing this project

README

          

# htmltables

Library for normalizing HTML tables (adding “physical grid” coordinates to each cell). Requires xslt-util

## Description

This implements Andrew J Welch's [Table Normalization in XSLT 2.0](http://andrewjwelch.com/code/xslt/table/table-normalization.html) in an XSLT function:

```xslt

```

Consider an XML or XHTML document containing HTML tables

```xhtml



a
b


c


d

```

Applying the XSLT function `htmltable:normalize()` will add virtual cells for each colspan and rowspan.

```
------------- -------------
| a | b | | a | b |
------- - -------------
| c | | --> | c | b |
------------- -------------
| d | | d | d |
------------- -------------
```

After the normalization, each cell contains `data` attributes which state the former position in the original table.

```xhtml



a
b


c
b


d
d

```