CSS tabel-uitleg Eiendom
Voorbeeld
Stel verskillende tabeluitlegalgoritmes:
table.a {
table-layout: auto;
width: 180px;
}
table.b {
table-layout:
fixed;
width: 180px;
}
Definisie en gebruik
Die table-layout
eienskap definieer die algoritme wat gebruik word om tabelselle, rye en kolomme uit te lê.
Wenk: Die belangrikste voordeel van tafeluitleg: vas; is dat die tabel baie vinniger weergee. Op groot tafels sal gebruikers geen deel van die tabel sien totdat die blaaier die hele tabel weergegee het nie. Dus, as jy tabel-uitleg: vas gebruik, sal gebruikers die bokant van die tabel sien terwyl die blaaier die res van die tabel laai en weergee. Dit gee die indruk dat die bladsy baie vinniger laai!
Standaard waarde: | outo |
---|---|
Geërf: | geen |
Animateerbaar: | geen. Lees oor animeerbaar |
Weergawe: | CSS2 |
JavaScript-sintaksis: | objek .style.tableLayout="fixed" |
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Property | |||||
---|---|---|---|---|---|
table-layout | 14.0 | 5.0 | 1.0 | 1.0 | 7.0 |
CSS-sintaksis
table-layout: auto|fixed|initial|inherit;
Eiendomswaardes
Value | Description | Play it |
---|---|---|
auto | Browsers use an automatic table layout algorithm. The column width is set by the widest unbreakable content in the cells. The content will dictate the layout | |
fixed | Sets a fixed table layout algorithm. The table and column widths are set by the widths of table and col or by the width of the first row of cells. Cells in other rows do not affect column widths. If no widths are present on the first row, the column widths are divided equally across the table, regardless of content inside the cells | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Verwante bladsye
CSS-tutoriaal: CSS-tabel
HTML DOM verwysing: tableLayout eiendom