HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> table, td, th{ border: 1px solid black; } table{ width: 200px; } #point{ caption-side: top; } </style> </head> <body> <h1>CSS caption-side Property</h1> <table> <caption>Table 1.1 User Details</caption> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Jos</td> <td>28</td> </tr> <tr> <td>Alex</td> <td>34</td> </tr> </table> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("table")[0]; function myFunction(){ x.style.captionSide = "bottom"; } </script> <p><strong>Note</strong>: Click on the button to change the 'caption-side' from 'top' (default) to 'bottom'.</p> </body> </html>
OUTPUT
×

Save as Private