<!DOCTYPE HTML>
<html>
<head>
<meta charset="gbk">
<title>table</title>
</head>
<body>
<table id="tb_
<tbody>
<tr align="center" bgcolor="#dcdcdc">
<td style="width:
<td>試用時間</td><td>轉正時間</td><td>性別</td><td>姓名拼音</td>
<td>生日時間</td><td>民族</td><td>身高</td>
</tr>
<tr>
<td>
<td>
<td>
</tr>
<tr>
<td>
<td>
<td>
</tr>
<tr>
<td>
<td>
<td>
</tr>
</tbody>
</table>
<script type="text/javascript">
var tTD; //用來存儲當前更改寬度的Table Cell
var table = document
for (j =
table
//記錄單元格
tTD = this;
if (event
tTD
tTD
tTD
}
//記錄Table寬度
//table = tTD; while (table
//tTD
};
table
//結束寬度調整
if (tTD == undefined) tTD = this;
tTD
tTD
};
table
//更改鼠標樣式
if (event
this
else
this
//取出暫存的Table Cell
if (tTD == undefined) tTD = this;
//調整寬度
if (tTD
tTD
if (tTD
tTD
//調整列寬
tTD
tTD
//調整該列中的每個Cell
table = tTD; while (table
for (j =
table
}
//調整整個表
//table
//table
}
};
}
</script>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20107.html