bughelp wanted
Repository metrics
- Stars
- (201 stars)
- PR merge metrics
- (PR metrics pending)
Description
When a table is nested in a cell, selecting cells gives unexpected results. For example:
<table id="main">
<tr>
<td>Main Cell</td>
</tr>
<tr>
<td>
<table id="child">
<tr>
<td>Child cell</td>
</tr>
</table>
</td>
</tr>
</table>
To be able to distinguish between the rows of the main table and the rows of the nested table, an option can be added to select rows (with tr as default):
Wholly.DEFAULTS = {
rowSelector: 'tr',
...
}
The rows selection is set as:
wholly.indexTable = function (table) {
var tableIndex = wholly.generateTableMatrix(table),
rows = table.find(this.options.rowSelector);
...
}
And for the example above:
<table id="main">
<tr>
<td>Main Cell</td>
</tr>
<tr>
<td>
<table id="child">
<tr class="skip">
<td>Child cell</td>
</tr>
</table>
</td>
</tr>
</table>
$('#main')wholly({
rowSelector: 'tr:not(.skip)',
...
});