HTML DOM captionSide Property
Complete Style Object Reference
Definition and Usage
The captionSide property sets the position of the table caption.
Syntax
Object.style.captionSide=top|bottom|left|right
|
Possible Values
Value |
Description |
top |
Default. Positions the table caption above the table |
bottom |
Positions the table caption below the table |
left |
Positions the table caption to the left of the table |
right |
Positions the table caption to the right of the table |
Example
The following example moves the table caption:
<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>
|
Try-It-Yourself Demos
captionSide - Position the table caption
Complete Style Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|