Properti HTML DOM Style captionSide
Definisi dan Penggunaan
captionSide set properti atau mengembalikan posisi header tabel.
tatabahasa
Pengaturan properti captionSide:
Object.style.captionSide="top|bottom|inherit"
Kembali sifat captionSide:
Object.style.captionSide
值 | 描述 |
---|---|
top | 默认。把表格标题定位在表格之上。 |
bottom | 把表格标题定位在表格之下。 |
inherit | captionSide 属性的值从父元素继承。 |
Dukungan Browser
Semua browser utama mendukung properti captionSide.
Catatan: IE7 dan versi sebelumnya tidak mendukung properti captionSide.IE8 hanya menyediakan! DOCTYPE didukung properti captionSide. IE9 mendukung properti captionSide.
contoh
contoh
Tabel sundulan ke bawah meja:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
. Document.getElementById ( "myCap") style.captionSide = "bawah";
}
</ Script>
</ Kepala>
<Body>
<Table border = "1">
<Caption id = "myCap"> tabungan saya </ caption>
<Tr>
<Th> Bulan </ th>
<Th> Tabungan </ th>
</ Tr>
<Tr>
<Td> Januari </ td>
<Td> $ 100 </ td>
</ Tr>
<Tr>
<Td> Februari </ td>
<Td> $ 150 </ td>
</ Tr>
</ Table>
Situs
<Tombol type = "button" onclick = "displayResult ()"> Ponsel judul tabel </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi displayResult () {
. Document.getElementById ( "myCap") style.captionSide = "bawah";
}
</ Script>
</ Kepala>
<Body>
<Table border = "1">
<Caption id = "myCap"> tabungan saya </ caption>
<Tr>
<Th> Bulan </ th>
<Th> Tabungan </ th>
</ Tr>
<Tr>
<Td> Januari </ td>
<Td> $ 100 </ td>
</ Tr>
<Tr>
<Td> Februari </ td>
<Td> $ 150 </ td>
</ Tr>
</ Table>
Situs
<Tombol type = "button" onclick = "displayResult ()"> Ponsel judul tabel </ button>
</ Body>
</ Html>
Coba »
gaya Objects