?
This document uses PHP Chinese website manual Release
table-layout:auto | fixed
默認(rèn)值:auto
適用于:table系元素
繼承性:有
動(dòng)畫性:否
計(jì)算值:指定值
auto:默認(rèn)的自動(dòng)算法。布局將基于各單元格的內(nèi)容,換言之,可能你給某個(gè)單元格定義寬度為100px,但結(jié)果可能并不是100px。表格在每一單元格讀取計(jì)算之后才會(huì)顯示出來,速度很慢
fixed:固定布局的算法。在這算法中,水平布局是僅僅基于表格的寬度,表格邊框的寬度,單元格間距,列的寬度,而和表格內(nèi)容無關(guān)。也就是說,內(nèi)容可能被裁切
通常fixed算法會(huì)比auto算法高效,尤其是對(duì)于那些長(zhǎng)表格來說。fixed算法使得表格可以像其它元素一樣一行一行的渲染。
對(duì)應(yīng)的腳本特性為tableLayout。
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0+ | 2.0+ | 4.0+ | 6.0+ | 15.0+ | 6.0+ | 2.1+ | 18.0+ |
<section id="bd"> <section id="syntax" class="g-mod g-attr"> <h2 class="tit">語法:</h2> <div class="cont"> <p><strong>table-layout</strong>:auto | fixed</p> <p><strong>默認(rèn)值</strong>:<mark class="defaultvalue">auto</mark></p> <p><strong>適用于</strong>:table系元素</p> <p><strong>繼承性</strong>:有</p> <p><strong>動(dòng)畫性</strong>:否</p> <p><strong>計(jì)算值</strong>:指定值</p> </div> </section> <section id="value" class="g-mod g-attr"> <h2 class="tit">取值:</h2> <div class="cont"> <dl> <dt>auto:</dt> <dd>默認(rèn)的自動(dòng)算法。布局將基于各單元格的內(nèi)容,換言之,可能你給某個(gè)單元格定義寬度為100px,但結(jié)果可能并不是100px。表格在每一單元格讀取計(jì)算之后才會(huì)顯示出來,速度很慢</dd> <dt>fixed:</dt> <dd>固定布局的算法。在這算法中,水平布局是僅僅基于表格的寬度,表格邊框的寬度,單元格間距,列的寬度,而和表格內(nèi)容無關(guān)。也就是說,內(nèi)容可能被裁切</dd> </dl> </div> </section> <section id="intro" class="g-mod g-attr"> <h2 class="tit">說明:</h2> <div class="cont"> <strong>設(shè)置或檢索表格的布局算法。</strong> <ul> <li>通常fixed算法會(huì)比auto算法高效,尤其是對(duì)于那些長(zhǎng)表格來說。fixed算法使得表格可以像其它元素一樣一行一行的渲染。</li> <li>對(duì)應(yīng)的腳本特性為<strong>tableLayout</strong>。</li> </ul> </div> </section> <section id="compatible" class="g-mod g-attr"> <h2 class="tit">兼容性:</h2> <div class="cont"> <ul class="support-type"> <li><span class="support">淺綠</span> = 支持</li> <li><span class="unsupport">紅色</span> = 不支持</li> <li><span class="partsupport">粉色</span> = 部分支持</li> </ul> <table class="g-data"> <thead> <tr> <th>Values</th> <th>IE</th> <th>Firefox</th> <th>Chrome</th> <th>Safari</th> <th>Opera</th> <th>iOS Safari</th> <th>Android Browser</th> <th>Android Chrome</th> </tr> </thead> <tbody> <tr> <td><strong>Basic Support</strong></td> <td class="support">6.0+</td> <td class="support">2.0+</td> <td class="support">4.0+</td> <td class="support">6.0+</td> <td class="support">15.0+</td> <td class="support">6.0+</td> <td class="support">2.1+</td> <td class="support">18.0+</td> </tr> </tbody> </table> </div> </section> <section id="example" class="g-mod g-attr"> <h2 class="tit">示例:</h2> <div class="cont"> <textarea cols="90" rows="10"><!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>table-layout_CSS參考手冊(cè)_web前端開發(fā)參考手冊(cè)系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> h1{font-size:16px;font-family:Arial;} .auto{table-layout:auto;width:350px;} .fixed{table-layout:fixed;width:350px;} </style> </head> <body> <h1>auto: 表格自動(dòng)算法</h1> <table border="1" class="auto"> <tbody> <tr> <td>表格自動(dòng)算法,寬度將基于單元格的內(nèi)容自動(dòng)拉伸</td> <td>表格自動(dòng)算法</td> <td>表格自動(dòng)算法</td> </tr> <tr> <td>表格自動(dòng)算法</td> <td>表格自動(dòng)算法</td> <td>表格自動(dòng)算法</td> </tr> </tbody> </table> <h1>fixed: 表格固定算法</h1> <table border="1" class="fixed"> <tbody> <tr> <td>表格固定算法布局</td> <td>表格固定算法</td> <td>表格固定算法</td> </tr> <tr> <td>表格固定算法</td> <td>表格固定算法</td> <td>表格固定算法</td> </tr> </tbody> </table> </body> </html> </textarea> <p><input type="button" value="運(yùn)行" class="g-btn g-btn-sure"><input type="button" class="g-btn g-btn-copy" value="復(fù)制"></p> </div> </section> </section>
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例