表行的底边不是visble转换时html以MS word

0

的问题

我想转换一些HTML内容为MS word使用以下办法,但一些风格,我正试图设置为表行(例如边境下的)不是在所有可见光在转化为word文档。 有人可以帮我个忙吗?

<html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
    xmlns="http://www.w3.org/TR/REC-html40">
    <body>
        <table>
            <tr style="border-bottom:2pt solid #AFAFAF">
               <td>One</td>
               <td>1</td>
            </tr>
            <tr style="border-bottom:2pt solid #AFAFAF">
               <td>One</td>
               <td>1</td>
             </tr>
        </table>
    </body>
</html>

我甚至试图设置 style="mso-border-bottom-alt: solid #AFAFAF 2pt;" 它没有工作。 我的要求是非常具体的,我应该有底部的边界对每一个行。

css html html-table ms-word
2021-11-23 16:54:29
1

最好的答案

0

如前所述通过 Azu,设置边界到底 <td> 而不是的 <tr> 标签做的伎俩沿用 cellspacing="0"<table>.

<html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
    xmlns="http://www.w3.org/TR/REC-html40">
    <body>
        <table width="100%" cellspacing="0">
            <tr>
               <td style="border-bottom:2pt solid #AFAFAF">One</td>
               <td style="border-bottom:2pt solid #AFAFAF">1</td>
            </tr>
            <tr>
               <td style="border-bottom:2pt solid #AFAFAF">One</td>
               <td  style="border-bottom:2pt solid #AFAFAF">1</td>
             </tr>
        </table>
    </body>
</html>
2021-11-23 17:30:21

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................