zoukankan      html  css  js  c++  java
  • css定义表格边框和表头

    < html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>一个css类封装的细线表格边框</title>
    <style type="text/css">
    <!--
    .mytable {
    border-collapse : collapse;
    }
    .mytable td {
            background-color: #CCFFff;
            border: 1px solid #ff9900;
    }
    .mytable th
    {background-color: #CCFFcc;
     border: 1px solid #ff9900;
    }

    .tdwidth{30px;}  --控制列的宽度,只需要写在一个td中就可以控制整个列的宽度
    -->
    </style>
    </head>

    <body>
    <table width="300" border="0" cellpadding="0" cellspacing="0" class="mytable" >
    <thead >
    <tr>
     <th class="tdwidth">&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>
    </thead >
      <tr >
        <td >&nbsp;</td>
        <td>&nbsp;</td>
        <td class="tdwidth">只需要写在一个td中就可以控制整个列的宽度</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </body>
    < /html >

  • 相关阅读:
    242
    241
    240
    「音乐」(G)I-DLE—화(火花) (HWAA)
    「音乐」Red Velvet—Psycho
    「音乐」Taylor Swift—the lakes (bonus track)
    「笔记」DP简单笔记
    「游记」CSP2020-S2游记
    「音乐」BLACKPINK-Ice Cream (with Selena Gomez)
    matlab 2021a linux 版本下载
  • 原文地址:https://www.cnblogs.com/chenyuwang2009/p/2723931.html
Copyright © 2011-2022 走看看