0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

笑顔になるための表を作成htmlひな形

Posted at
hoge.html
<table id="xx" border="1">
    
</table>
<script>
function RowCellLength(table){
    console.log("row-length:", table.rows.length)
    // console.log("cell-length:", table.rows[0].cells.length)
}
function createTable(table, dates,rows) {
    newRow = table.insertRow(rows)
    for (let i=0; i<dates; i++) {
        newCell = newRow.insertCell(0)
        newCell.colSpan = "1"  //colspan="1"をセット
        newCell.rowSpan = "1" //rowspan="1"をセット
        newCell.innerHTML = "new cell"  //セルの中に値を入力
    }

    newCell = newRow.insertCell(0)
    newCell.colSpan = "1"  //colspan="1"をセット
    newCell.rowSpan = "2" //rowspan="2"をセット
    newCell.innerHTML = "hogehoge"
    newRow1 = table.insertRow(rows+1)

    for (let i=0; i<dates; i++) {
        newCell = newRow1.insertCell(0)
        newCell.colSpan = "1"  //colspan="1"をセット
        newCell.rowSpan = "1" //rowspan="1"をセット
        newCell.innerHTML = "new cell"  //セルの中に値を入力
    }
} 

var members = 10
var dates = 10
for (let i=0; i<members; i++) {
    createTable(xx, dates,2*i)
}

</script>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?