Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> caption { background: #ccc; } .top caption { caption-side: top; } .bottom caption { caption-side: bottom; } table, th, td { border: 1px solid #cccccc; padding: 3px; } td { background-color: #1c87c9; color: #ffffff; } </style> </head> <body> <h2>Caption-side property example</h2> <p>Here the caption-side is set to "top":</p> <table class="top"> <caption>ABOVE</caption> <tr> <td>Some text</td> <td>Some text</td> </tr> </table> <br> <p>Here the caption-side is set to "bottom":</p> <table class="bottom"> <caption>BELOW</caption> <tr> <td>Some text</td> <td>Some text</td> </tr> </table> </body> </html>