电竞比分网-中国电竞赛事及体育赛事平台

分享

HTML中table表格的常用使用

 行走在理想邊緣 2019-03-25
table表格:
【常用屬性】
        1.border:給表格加邊框
            當(dāng)border屬性值增大時(shí),只有外圍框線增加,單元格的邊框始終為1px;
        2.bordercolor="blue" 邊框顏色
        3.width、height:表格的寬高
        4.cellspacing:單元格與單元格之間的間隙距離
           當(dāng)cellspacing=“0”,只會(huì)使單元格間隙為0,但不會(huì)合并邊框線。
           表格邊框合并:style=“border-collapsecollapse”,
           無需再寫cellspacing="0"(邊框合并,間隙為零,間線變寬)
        5.cellpadding:每個(gè)單元格中的內(nèi)容與邊框的距離
        6.align:表格在屏幕的左中右位置顯示,left、center、right
            注意:給表格加上align屬性,相當(dāng)于讓表格浮動(dòng)
            會(huì)直接打破表格后面元素的原有排列方式
        7.bgcolor:背景色  等同于style="background-color:yellow"(提倡用css3的顯示效果)
        8.backgroundbackground="img/compter.jpg"設(shè)置背景圖片
          等同于style="background-image:;" 且背景圖片會(huì)覆蓋背景顏色

背景圖片:
     background="../img/lianxiang.jpg"
     background-image: url('../img/lianxiang.jpg')"

<table border="10" bordercolor="blue" width="500px" height="150px"
       style="border-collapse: collapse;background-color: yellow;
        cellpadding="30px"  align="center" >

 <tr>
        <td>手機(jī)充值</td>
        <td>IP</td>
        <td>網(wǎng)游</td>
    </tr>
    <tr>
        <td>移動(dòng)</td>
        <td>聯(lián)通</td>
        <td>電信</td>
    </tr>
</table>


請(qǐng)選中你要保存的內(nèi)容,粘貼到此文本框

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多