表格斜线 时间:2021-03-16 人气:0 想了解表格斜线的相关内容吗,在本文为您仔细讲解的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:表格斜线,下面大家一起来学习吧。 New Document <script Language="javascript"> function a(x,y,color) {document.write("")} </script> 张三 李四 王五 数学 55 66 77 英语 99 68 71 语文 33 44 55 <script> function line(x1,y1,x2,y2,color) { var tmp if(x1>=x2) { tmp=x1; x1=x2; x2=tmp; tmp=y1; y1=y2; y2=tmp; } for(var i=x1;i<=x2;i++) { x = i; y = (y2 - y1) / (x2 - x1) * (x - x1) + y1; a(x,y,color); } } //line(1,1,100,100,"000000"); line(td1.offsetLeft,td1.offsetTop,td1.offsetLeft+td1.offsetWidth,td1.offsetTop+td1.offsetHeight,'#000000') </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容