样式设置整个tsnle在页面得中间
css:
<style>
table{
/* 让整个table居中,显示在页面正中间 */
margin: auto;
}
</style>
script:
<script type="text/javascript">
//用弹框内容自己控制表格的长宽和边框
var w = prompt("请输入表格的宽度");
var h = prompt("请输入表格的高度");
var b = prompt("请输入表格的边框");
//随机生成0~255的值。
var num1 =Math.random()*255;
var num2 =Math.random()*255;
var num3 =Math.random()*255;
console.log(w,h,b)
document.write("<table width="+w+" height="+h+" border="+b+" style='background:rgb("+num1+","+num2+","+num3+")'>")//背景颜色有三个数值组成(颜色由0~255),随数解决
document.write("<tr><td>1<