html JS.HTML.CSS.Live编码视频:动态table.EX1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html JS.HTML.CSS.Live编码视频:动态table.EX1相关的知识,希望对你有一定的参考价值。

table {
  width:100%;
  border:1px solid;
  border-collapse: collapse;
}


tr, th, td {
  border:1px solid;
  font-family:courier;
}

td {
  text-align:center;
  padding:10px;
  
}
function insertRow() {
  var table = document.querySelector("#myTable");
  
  // without parameters, insert at the end,
  // otherwise parameter = index where the row will be inserted
  var row = table.insertRow();
  
  row.innerHTML = "<td>New</td><td>New</td><td>New</td>"
  
  /*
  var cell1 = row.insertCell();
  cell1.innerHTML = "<b>New cell1</b>";
  var cell2 = row.insertCell();
  cell2.innerHTML = "New cell2";
  var cell3 = row.insertCell();
  cell3.innerHTML = "New cell3";
  */
}

function deleteFirstRow() {
  var table = document.querySelector("#myTable");
  table.deleteRow(1); // 0 is the header
}
JS.HTML.CSS.Live coding video: dynamic table.EX1
------------------------------------------------


A [Pen](https://codepen.io/Onlyforbopi/pen/zJgyNe) by [Pan Doul](https://codepen.io/Onlyforbopi) on [CodePen](https://codepen.io).

[License](https://codepen.io/Onlyforbopi/pen/zJgyNe/license).
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>A typical HTML table with simple styling</title>
</head>
<body>
<table id="myTable">
 <caption>A typical HTML table</caption>  
  <tr>
    <th scope="col">Given Name</th>
    <th scope="col">Family Name</th> 
    <th scope="col">Age</th>
  </tr>
  <tr>
    <td>Michel</td>
    <td>Buffa</td> 
    <td>52</td>
  </tr>
  <tr>
    <td>Dark</td>
    <td>Vador</td> 
    <td>Unknown</td>
  </tr>
    <tr>
    <td>Luke</td>
    <td>Skywalker</td> 
    <td>Unknown</td>
  </tr>
</table>
  <p>Click to add a new row</p>
  <button onclick="insertRow();">Add a new row</button>
  <p>Click to delete the first row of the table</p>
  <button onclick="deleteFirstRow();">Delete first row</button>
</body>
</html>

以上是关于html JS.HTML.CSS.Live编码视频:动态table.EX1的主要内容,如果未能解决你的问题,请参考以下文章

HTML5中如何显示视频HTML5视频播放

HTML 5 视频 -- video 元素

视频参数(流媒体系统,封装格式,视频编码,音频编码,播放器)对比

iOS音频AAC视频H264编码 推流最佳方案

AVAssetWriter视频数据编码

HTML5 video视频字幕的使用和制作