Firefox 1 pixel bug with border-collapse, workaround?

后端 未结 12 2599
误落风尘
误落风尘 2020-12-07 18:59

Is there any workaround for the following \"1 pixel to the left\" bug?

    

        
12条回答
  •  暖寄归人
    2020-12-07 19:21

    Remove the border-collapse and use cellspacing=0 instead.

    It happens because when you set border-collapse:collapse, Firefox 2.0 puts the border to the outside of the tr. The other browsers put it on the inside.

    Set your border widths to 10px in your code to see what is really happening.


    edit after OP edit

    You can use the old table "border" trick. Set the background color on the table. Set the td and th color to white. User cellspacing = 1;

    table {background-color: green;width:100%;}
    td, th{background-color:white;}
    
    
    Table header info
    Col1 Col2
    Hello World
    Table footer info

提交回复
热议问题