用JavaScript如何改变表格边框的宽度?
要更改表格边框的宽度,请使用DOMborder属性。您可以尝试运行以下代码来更改JavaScript中表格边框的宽度-
示例
<!DOCTYPE html>
<html>
<head>
<script>
function borderFunc(x) {
document.getElementById(x).style.border = "5px dashed blue";
}
</script>
</head>
<body>
<table style = "border:2px solid black" id = "newtable">
<tr>
<td>One</td>
<td>Two</td>
</tr>
<tr>
<td>Three</td>
<td>Four</td>
</tr>
<tr>
<td>Five</td>
<td>Six</td>
</tr>
</table>
<p>
<input type = "button" onclick = "borderFunc('newtable')"
value = "Change Border Width">
</p>
</body>
</html>热门推荐
6 贫困户祝福语简短
10 杨奕老师祝福语简短
11 高考前祝福语简短字句
12 早晨好正能量祝福语简短
13 今日祝福语简短10字
14 姐妹结婚快乐祝福语简短
15 老哥出门祝福语简短语
16 孙女结婚姥姥祝福语简短
17 群里祝福语简短幽默
18 出阁祝福语简短句子