<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script type="text/javascript">
function changeFont(){
//document.getElementById("table1").style.fontSize="9px";
document.getElementById("table1").style.lineHeight="10px";
}
</script>
</head> <body>
<table id = "table1" border=1>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
</tr>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
</tr>
</table>
<input type="button" value="test" onclick="changeFont();"/>
</body>
</html>刚刚试了一下博主说的问题,测试是没有什么问题的,你看一下是不是引号的问题!!
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script type="text/javascript">
function changeFont(){
//document.getElementById("table1").style.fontSize="9px";
document.getElementById("table1").style.lineHeight="10px";
}
</script>
</head> <body>
<table id = "table1" border=1>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
</tr>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
</tr>
</table>
<input type="button" value="test" onclick="changeFont();"/>
</body>
</html>刚刚试了一下博主说的问题,测试是没有什么问题的,你看一下是不是引号的问题!!
$("#table1").find("td").css("fontSize", "20px");
$("#table1").find("td").css("lineHeight", "50px");
.table td{
font-size:9px;
line-height:10px;
}
</style>
<script type="text/javascript">
document.getElementById("table1").className = "table";
</script>