1px vs thin, problems with IE and Excel

I have an html table that displays in IE and Excel (for reporting)

If I set the border width to thin, it displays a 2px border in IE and a 1px border in Excel.

However, if I set it to 1px, it shows a 1px border in IE and a 2px border in Excel (???).

How can I make them BOTH show a 1px border as it looks awful with a 2px border.

+5
source share
4 answers

Saving the excel file in html encodes CSS as follows:

.xl32
{mso-style-parent:style0;
border-top:.5pt solid windowtext;
border-right:1.0pt solid windowtext;
border-bottom:1.0pt solid windowtext;
border-left:.5pt solid windowtext;}

.5 is displayed as a regular line, 1.0 as a thick line So I think setting te with .5pt should work ...

+5

HTML, Excel. , IE - . (, , .)

, , - "", CSS IE. . QuirksMode.org IE.

:

<style>
   table { border: thin solid black; }
</style>

<!--[if lt IE 9]>
<style>
   table { border: 1px solid black; }
</style>
<![endif]-->
+1

, ... untested:

CSS thin, Excel 1px border, IE 1px border

<!--[if IE]>
    //style rule for `border:1px` etc.
<![endif]-->
0

.

border-collapse: collapse;

. 2px IE

0

All Articles