Set the table caption - Javascript CSS Style Property

Javascript examples for CSS Style Property:captionSide


Set the table caption

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
table, th, td {
    border: 1px solid black;
    margin: 10px;
</style>/*from   www .j av a 2s  . com*/

<p>Click the button to get the position of the table caption.</p>

<button onclick="myFunction()">Test</button>

  <caption id="myCap" style="caption-side:bottom;">Table 1.1 Customers</caption>

function myFunction() {
    document.getElementById("myCap").style.captionSide = 'top';


Related Tutorials