功能:实现成绩单单击表格可对数据进行修改,数据通过随机数生成。且对输入的数字大小有正则验证例如不小于0不大于100,并进行求和。
截图:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
html.body {
width: 100%;
height: 100%;
}
h1 {
margin-top: 50px;
text-align: center;
}
#main {
margin-top: 50px;
}
#t {
margin: 0 auto;
width: 50%;
border-collapse: collapse;
}
thead {
background-color: rgb(235, 228, 228);
}
caption {
font-size: 24px;
margin: 12px;
background-color: #99ccff;
}
th {
background-color: #eee;
}
th,
td {
text-align: center;
border: solid 1px black;
padding: 5px;
width: 50px;
}
tfoot td {
text-align: center;
color: #99ccff;
}
</style>
</head>
<body>
<h1>可编辑表格</h1>
<div id="main">
<table id="t">
<tr>
<th>学号</th>
<th>姓名</th>