public void deleteCell(int index) {/* Docs: https://html.spec.whatwg.org/multipage/tables.html#dom-tr-deletecell */ CEReactions.Wrap_CEReaction(nodeDocument.defaultView, () => { int cellCount = cells.Count; if (index < -1 || index > cellCount) { throw new IndexSizeError(); } if (index == -1 && cellCount > 0) { removeChild(cells.Last()); } else { var targetCell = cells.ElementAt(index); removeChild(targetCell); } }); }
public void deleteRow(int index) {/* Docs: https://html.spec.whatwg.org/multipage/tables.html#dom-tbody-deleterow */ CEReactions.Wrap_CEReaction(nodeDocument.defaultView, () => { int rowCount = rows.Count; if (index < -1 || index > rowCount) { throw new IndexSizeError(); } if (index == -1) { var row = rows.Last(); removeChild(row); } else { var row = rows.ElementAt(index); removeChild(row); } }); }