日期:2014-05-17  浏览次数:20572 次

怎么用CSS来做无边框的表格?
我用photoshop切片并输出页面,输出的页面是一个表格,里面包含了很多图片,但是改用CSS的无法做到无缝拼接

请帮助一下

photoshop输出的源代码:http://xyjsc.zisu.edu.cn/test2.htm
HTML code
<table id="__01" width="500" height="500" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="3">
            <img src="images/caonima_01.jpg" width="500" height="161" alt=""></td>
    </tr>
    <tr>
        <td rowspan="2">
            <img src="images/caonima_02.jpg" width="139" height="339" alt=""></td>
        <td>
            <img src="images/caonima_03.jpg" width="231" height="178" alt=""></td>
        <td rowspan="2">
            <img src="images/caonima_04.jpg" width="130" height="339" alt=""></td>
    </tr>
    <tr>
        <td>
            <img src="images/caonima_05.jpg" width="231" height="161" alt=""></td>
    </tr>
</table>


我改用CSS后的页面:http://xyjsc.zisu.edu.cn/test1.htm
HTML code
<table style="width:500px; height:500px; margin:0 auto; padding:0px; border-spacing:0px; border-style:none; border-collapse:collapse;">
    <tr>
        <td colspan="3">
            <img src="images/caonima_01.jpg" width="500" height="161" alt="" /></td>
    </tr>
    <tr>
        <td rowspan="2">
            <img src="images/caonima_02.jpg" width="139" height="339" alt="" /></td>
        <td>
            <img src="images/caonima_03.jpg" width="231" height="178" alt="" /></td>
        <td rowspan="2">
            <img src="images/caonima_04.jpg" width="130" height="339" alt="" /></td>
    </tr>
    <tr>
        <td>
            <img src="images/caonima_05.jpg" width="231" height="161" alt="" /></td>
    </tr>
</table>


最好是把style直接写在table里,以方便使用class,谢谢

------解决方案--------------------
楼主搜下 reset css 并引入进你的页面就可以了