实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script>
5
function leftAlign()
6
{
7
document.getElementById('header').align="left";
8
}
9
</script>
10
</head>
11
<body>
12
13
<table width="100%" border="1">
14
<tr id="header">
15
<th>Firstname</th>
16
<th>Lastname</th>
17
</tr>
18
<tr>
19
<td>Peter</td>
20
<td>Griffin</td>
21
</tr>
22
</table>
23
<br>
24
<input type="button" onclick="leftAlign()" value="Left-align table row" />
25
26
<p><b>Note:</b> This example does not work in Internet Explorer.</p>
27
28
</body>
29
</html>