2020-04-07から1日間の記事一覧

JavascriptでcolSpanやrowSpanが含まれたテーブルの特定のセルの相対的なインデクス(cellIndex)を調べる

function cellsIndex (table = document.querySelector ('table')) { let rows = table.tHead ? table.tHead.rows: [table.rows[0]],//tHeadの全てor tBodyの最初の行 rst = new Map, buf = [ ]; if (! rows.length) throw new Error (); //すべてのセルを走…