<html>
<head>
<title>Abakada HTML Demo: CAPTION align Attribute</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<style type="text/css">
<!--
button { padding: 2 5 }
-->
</style>
</head>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>Abakada HTML Demo: CAPTION align Attribute</h2></div>
<hr size=1 width=92%>
<center>
<h5>This example shows the effects of applying different values possible for the <b>align</b> attribute,
when used with the <b>CAPTION</b> element.</h5>
<br>
<table cellspacing=1 width=70% class="data">
<caption id="msg">Click a button to change this caption's position</caption>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th></tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td></tr>
<tr>
<td>Cell 4</td>
<td>Cell 5</td>
<td>Cell 6</td></tr>
</table>
<h5 id="theSyntax"><CAPTION align="center"></h5>
<table>
<tr>
<th>Options</th>
<td><button onclick="setAlign ( 'bottom' )">bottom</button>
<button onclick="setAlign ( 'left' )">left</button>
<button onclick="setAlign ( 'center' )">center</button>
<button onclick="setAlign ( 'right' )">right</button>
<button onclick="setAlign ( 'top' )">top</button></td></tr>
</table>
<script language="JavaScript">
<!--
var el = document.all ? document.all [ 'msg' ] : document.getElementById ( 'msg' );
var synt = document.all ? document.all [ 'theSyntax' ] : document.getElementById ( 'theSyntax' );
function setAlign ( opt ) {
el.align = opt;
txt = '<CAPTION align="' + el.align + '">';
if ( document.all ) synt.innerText = txt;
else if ( dom ) synt.childNodes [ 0 ].nodeValue = txt;
if ( opt == "top" || opt == "bottom" ) {
if ( document.all )
el.innerText = "This caption aligns " + opt + "-center";
else if ( dom )
el.childNodes [ 0 ].nodeValue = "This caption aligns " + opt + "-center";
}
else {
if ( document.all )
el.innerText= " This caption aligns " + el.align;
else if ( dom )
el.childNodes [ 0 ].nodeValue = "This caption aligns " + el.align;
}
}
//-->
</script>
</center>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>