test<...">

Firefox 2px table border graphic displays border as 1px

HTML

<table class="bad">
    <tr>
        <td>test</td>
    </tr>
</table>

<table class="ok">
    <tr>
        <td>test</td>
    </tr>
</table>

CSS

table {
    border-collapse: collapse;
}

table.ok {
    border: 1px solid black;
}

table.bad {
    border: 2px solid black;
}

http://jsfiddle.net/BD248/

Printing such HTML gives the same border for both tables in Firefox.

Other browsers like Chrome print a tighter border on .bad

How do I fix / fix the problem?

Setting the 3px border to .bad gives a “thick” border in Firefox that looks ugly.

+3
source share
1 answer

I ran into the same problem. This is not only related to tables. It also applies to div elements. Use pt (dots) as the unit for printing instead of px (pixels). Try:

div {border: 2pt solid red}
+1
source

All Articles