captionSide 屬性設(shè)置表格標題的位置。
Object.style.captionSide=top|bottom|left|right
值 | 描述 |
---|---|
top | 默認。把表格標題定位在表格之上。 |
bottom | 把表格標題定位在表格之下。 |
left | 把表格標題定位在表格的左邊。 |
right | 把表格標題定位在表格的右邊。 |
本例移動表格標題:
<html>
<head>
<style type="text/css">
caption
{
caption-side:bottom;
}
</style>
<script type="text/javascript">
function moveCaption()
{
document.getElementById('myTable').style.captionSide="right"
}
</script>
</head>
<body>
<table border="1" id="myTable">
<caption>This is a caption</caption>
<tr>
<td>100</td>
<td>200</td>
</tr>
<tr>
<td>300</td>
<td>400</td>
</tr>
</table>
<br />
<input type="button" onclick="moveCaption()"
value="Move table caption">
</body>
</html>
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點擊進入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號