CSS caption-side属性用于控制表格标题的位置。
您可以尝试运行以下代码来实现 标题侧属性:
<html> <head> <style> caption.top { caption-side:top } caption.bottom { caption-side:bottom } </style> </head> <body> <table style = "width:500px; border:3px solid gray;"> <caption class = "top"> Countries (Top Caption) </caption> <tr><td> India</td></tr> <tr><td> UK</td></tr> <tr><td> US</td></tr> <tr><td> Australia</td></tr> </table> <br /> <table style = "width:500px; border:3px solid blue;"> <caption class = "bottom"> Countries (Bottom caption) </caption> <tr><td> India</td></tr> <tr><td> UK</td></tr> <tr><td> US</td></tr> <tr><td> Australia</td></tr> </table> <br /> </body> </html>