表格内外边框属性测试

<!doctype html>
<html>
<head>
<!--表格内外边框属性测试-->
<style>
</style>
<script>
   var bord=new Array("void","above","below","hsides","vsides","lhs","rhs","box","border");//新建表格外边框frame数组
   var k=0;
var bord1=new Array("none","groups","rows","cols","all");//新建表格内边框rules属性数组
var c=0;
function te(){
var tab=document.getElementById("table1");
k=k+1;
alert(k);
if(k==bord.length){
k=0;
}
tab.setAttribute("frame",bord[k]);//更改frame属性
}
function te2(){
var tab=document.getElementById("table1");
c=c+1;
alert(c);
if(c==bord1.length){
c=0;
}
tab.setAttribute("rules",bord1[c]);//更改rules属性
}
</script>
<meta charset="UTF-8">
</head>
<body>
<table id="table1" cellspacing="1" cellpadding="1">
<tr>
<th>姓名</th><th>年龄</th><th>性别</th>
</tr>
<tr>
<td>奥巴马</td><td>50</td><td>男</td>
</tr>
<tr>
<td>川普</td><td>60</td><td>男</td>
</tr>
<tr>
<td>三胖</td><td>30</td><td>男</td>
</tr>
</table>
<input type="button" οnclick="te()" value="测试外边框"><input type="button" value="测试内边框" οnclick="te2()">
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值