【发布时间】:2017-03-26 19:18:11
【问题描述】:
我正在尝试创建一个简单的表格,允许用户输入他们的用户名和一个值,然后查看他们的值立即添加到表格中。
图片:
当前代码:
<!doctype html>
<html lang="en">
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 15px;
}
</style>
<head>
<meta charset="utf-8">
<meta name="description" content="page for t1 fantasy sports">
<title>T1 Fantasy</title>
</head>
<body>
<h1>T1 Fantasy Sports</h1>
<table style="width=100%">
<tr>
<th>Username</th>
<th>Total Points</th>
<th>Total Points Yesterday</th>
</tr>
<tr>
<td>nmaron</td>
</tr>
<tr>
<td>memaron</td>
</tr>
<tr>
<td>youngplum13</td>
</tr>
<tr>
<td>burstometry</td>
</tr>
<tr>
<td>Kermit</td>
</tr>
</table>
<form>
Username: <br>
<input type="text" name="username"></br>
Points Scored: <br>
<input type="number" name="points"></br>
<input type="submit" value="Submit">
</form>
</body>
</html>
对此非常陌生。我不想做任何复杂的事情,我需要将用户输入的值放在他们各自的用户名旁边。
【问题讨论】:
-
我试图弄清楚如何将数字放在正确的列下,然后增加总列的数字。我不知道如何增加特定的单元格。
标签: javascript html input html-table