HTML DOM Style captionSide property
Definition and Usage
captionSide property sets or returns the position of the table header.
grammar
Setting captionSide properties:
Object.style.captionSide="top|bottom|inherit"
Back captionSide properties:
Object.style.captionSide
值 | 描述 |
---|---|
top | 默认。把表格标题定位在表格之上。 |
bottom | 把表格标题定位在表格之下。 |
inherit | captionSide 属性的值从父元素继承。 |
Browser Support
All major browsers support captionSide property.
Note: IE7 and earlier versions do not support captionSide property.IE8 only provides! DOCTYPE supported captionSide property. IE9 support captionSide property.
Examples
Examples
The table header to the bottom of the table:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function displayResult () {
. Document.getElementById ( "myCap") style.captionSide = "bottom";
}
</ Script>
</ Head>
<Body>
<Table border = "1">
<Caption id = "myCap"> My savings </ caption>
<Tr>
<Th> Month </ th>
<Th> Savings </ th>
</ Tr>
<Tr>
<Td> January </ td>
<Td> $ 100 </ td>
</ Tr>
<Tr>
<Td> February </ td>
<Td> $ 150 </ td>
</ Tr>
</ Table>
<br>
<Button type = "button" onclick = "displayResult ()"> Mobile table heading </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function displayResult () {
. Document.getElementById ( "myCap") style.captionSide = "bottom";
}
</ Script>
</ Head>
<Body>
<Table border = "1">
<Caption id = "myCap"> My savings </ caption>
<Tr>
<Th> Month </ th>
<Th> Savings </ th>
</ Tr>
<Tr>
<Td> January </ td>
<Td> $ 100 </ td>
</ Tr>
<Tr>
<Td> February </ td>
<Td> $ 150 </ td>
</ Tr>
</ Table>
<br>
<Button type = "button" onclick = "displayResult ()"> Mobile table heading </ button>
</ Body>
</ Html>
try it"
Style Objects