Table borders do not display properly when converting from an HTML page in MS Word 2003

I have a slightly complicated setup. I specialize in XSLT, which I write for a third-party system. All CSS looks great in the browser. Now this system provides a button that converts my generated HTML to MS Word 2003.

However, table borders are not converted because they are displayed in the browser. There are many tables, and they have different border settings. For example, there is one that uses only the outer border and no borders inside. When converting to MS Word, the table is displayed with all the borders between the cells. Which I do not want.

I tried searching the Internet but did not find anything useful. Perhaps there are tips or tricks on how to set up table borders so that they understand MS Word correctly.

The third participant said the following: "The system simply transfers the HTML code created using the converter, which it finds in the installed version of Word."

I would be very grateful for the advice and help!

+3
source share
3 answers

I tried to get a table with only an outer border and no inner ones. I tried the following HTML:

<table border="1" frame="border" rules="none" cellpadding="4" cellspacing="0">

However, in Word, this table appears with both an external and an internal border, and not just with an external border, as I tried to get it.

, border. . , CSS , , :

 <table style="border: 1px black solid" ....>

<div>

 <div style="border: 1px black solid"><table .....></table></div>

? .

, ?

<table border="1" bordercolor="black" cellspacing="0" cellpadding="0">
 <tr><td>
  <table .... Your table  ........> </table>
 </td></tr>
</table>    

, 2010 -, , , , . , , CSS . , - . Word HTML.

+2

:

<table border=1 cellspacing=0 cellpadding=0 
       style='border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;'>
...
</table>
+5

, , , html . , , . html CSS/HTML.

+1
source

Source: https://habr.com/ru/post/1738467/


All Articles