zoukankan      html  css  js  c++  java
  • 用CSS设置Table的细边框的最好用的方法

    今天同事向我问了一个问题,他要设置table的边框,说实话,我也很少弄过table的边框。

    通过差一些资料http://blog.sina.com.cn/s/blog_565812e60100czbn.html

    我发现设置table的CSS为{border-collapse:collapse;border:none;},再设置td的CSS为{border:solid#000 1px;}是一个非常不错的方法。

    示例:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>导航页档</title>
        <style type="text/css">
            table
            {
                border-collapse: collapse;
                border: none;
                200px;
            }
            td
            {
                border: solid #000 1px;
            }
        </style>
    </head>
    <body>
        <table>
            <tr>
                <td>
                    军事
                </td>
                <td>
                    历史
                </td>
                <td>
                    新闻
                </td>
            </tr>
            <tr>
                <td>
                    军事
                </td>
                <td>
                    历史
                </td>
                <td>
                    新闻
                </td>
            </tr>
        </table>
    </body>
    </html>



  • 相关阅读:
    Netty 超时机制及心跳程序实现
    ZJUTACM
    寻找素数对
    HDU 1021 Fibonacci Again
    HDU 1019 Least Common Multiple
    HDU 1017 A Mathematical Curiosity
    HDU 1014 Uniform Generator
    HDU 1013 Digital Roots
    HDU 1008 Elevator
    Educational Codeforces Round 2 B. Queries about less or equal elements
  • 原文地址:https://www.cnblogs.com/xinlei/p/1763387.html
Copyright © 2011-2022 走看看