-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabletest.html
66 lines (58 loc) · 1.07 KB
/
tabletest.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict //EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Untitled Page</title>
<style>
td {
width: 2em;
height: 2em;
padding: 2em;
text-align: center;
}
tr:hover {
cursor: pointer;
background-color: whitesmoke;
}
.select {
background-color: yellow;
}
</style>
<script type="text/javascript">
var td1 = null;
var td2 = null;
function highlight(obj) {
if (td1 || td2) {
td1.className = null;
td2.className = null;
}
obj.cells[0].className = "select";
obj.cells[1].className = "select";
td1 = obj.cells[0];
td2 = obj.cells[1];
}
</script>
</head>
<body bgcolor="#ffffff">
<table>
<tr onclick="highlight(this);">
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr onclick="highlight(this);">
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
</tr>
<tr onclick="highlight(this);">
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
</tr>
</table>
</body>
</html>