日期:2014-05-20 浏览次数:20784 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style type="text/css">
#cont{width:1100px;}
.info{border: solid 1px blue;display:inline;}
.info td{border: solid 1px blue;}
</style>
</head>
<script type="text/javascript">
function getConent(){
var cont = document.getElementById("cont");
var infs = "";
var year = "2012";
for(var i = 1; i < 13; i++){
infs += "<table id="+year+i+" class=\"info\">"; //将年份和月份作为ID,方便后面获取数据。
infs += "<tr><td colspan=\"2\">"+year+"年"+i+"月水费信息</td></tr>";
infs += "<tr><td>用量</td><td><input type=\"text\" value=\"\" size=\"20\"/></td></tr>";
infs += "<tr><td>单价</td><td><input type=\"text\" value=\"\" size=\"20\"/></td></tr>";
infs += "<tr><td>费用发生日期</td><td><input type=\"text\" value=\"\" size=\"20\"/></td></tr>";
}
cont.innerHTML = infs;
}
</script>
<body onload="getConent()">
<div id="cont">
</div>
</body>
</html>