We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Transform HTML CSS box-shadow Styles to MS Word Table Border Styles using Java

Hi Team,

I am trying to implement different border bottom styles for my tabular data. I am not getting a solution for the below border style. PFA

image.png (9.4 KB)

I am using HTML string to convert it to MS word. So far I have tried using border-bottom & box-shadow.

border-bottom: 3px double #000!important;
box-shadow: 0 -2px 0 #000;

But it is not working as expected. It only shows the double border but not the box-shadow. My requirement is that I want a double border style with different border sizes.

I am using :
Java version : 1.8
Aspose word : 18.9 (license)

Can you please help me with this?

Regards,
Ashish M

@amestry29190,

The following HTML string, when converted to Word document using the latest (21.7) version of Aspose.Words for Java, should produce desired bottom border style for the first Cell of Table:

<html>
<head>
    <title>
    </title>
</head>
<body>
    <div>
        <table style="-aw-border-insideh:0.5pt single #000000; -aw-border-insidev:0.5pt single #000000; border-collapse:collapse">
            <tr>
                <td style="width:222.95pt; border-style:solid; border-width:0.75pt 0.75pt 4.5pt; padding-right:5.03pt; padding-left:5.03pt; vertical-align:top; -aw-border-bottom:3pt thin-thick-small-gap; -aw-border-left:0.5pt single; -aw-border-right:0.5pt single; -aw-border-top:0.5pt single">
                    <p style="margin-top:0pt; margin-bottom:0pt; font-size:11pt">
                        <span>&#xa0;</span>
                    </p>
                </td>
                <td style="width:222.95pt; border-style:solid; border-width:0.75pt; padding-right:5.03pt; padding-left:5.03pt; vertical-align:top; -aw-border:0.5pt single">
                    <p style="margin-top:0pt; margin-bottom:0pt; font-size:11pt">
                        <span>&#xa0;</span>
                    </p>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>
1 Like

Hi @awais.hafeez,

Thanks for the reply.

Your solution works on latest version but not on my licensed version that is 18.9.

Do you have any other solution that will work on 18.9 version or the only way to sort this out is to get the latest version?

Regards,
Ashish M

@amestry29190,

Please note that we do not provide support for older released versions of Aspose.Words. We also do not provide any fixes or patches for old versions of Aspose APIs. All fixes and new features are always added into new versions of our APIs. So, the only solution would be to upgrade to the latest 21.7 version of Aspose.Words for Java.