Text-align:center not working in DIV

I am trying to create word doc using html but word doc text alignment not comming correctly…
its very urgent please help me…

HTML :


<div>
    <div>
        <div class="passageText">
            <div style="font-size: 14pt; font-family: Times; font-weight: bold; text-align: center;">
                Apples for Bear<br />
                <br />
            </div>
            <div style="text-align: center; margin-top: 0pt; margin-bottom: 1em;">
                <img src="../images/79458.jpg" alt="" />
            </div>
            <table style="font-size: 12pt; font-family: Times; font-weight: normal;">
                <tr>
                    <td style="font-size: 12pt; font-family: Times; font-weight: normal; vertical-align: top; width: .25in;">1</td>
                    <td>
                        <div style="text-indent: 0.25in; margin-top: 0em; margin-bottom: 1em;">
                            One day, Bear decided what he wanted most was an apple. He went off to the forest
                            to find an apple tree. Before long, Bear found a tree with so many apples on it
                            he decided he wanted to gather a pile of apples. There was one problem. The apples
                            were at the top of the tree. Poor Bear jumped as high as he could, but he could
                            not reach the apples. Then he dragged over a big log and climbed up on it. He still
                            was not high enough to get even one sweet apple! Bear sat down. He felt very sorry
                            for himself. He saw a stick lying on the ground. It was very long and had a nice
                            point on each end. It was perfect for getting apples down from the tree. He had
                            just picked up the stick when suddenly a beaver came up behind him.
                        </div>
                    </td>
                </tr>
            </table>
            <table style="font-size: 12pt; font-family: Times; font-weight: normal;">
                <tr>
                    <td style="font-size: 12pt; font-family: Times; font-weight: normal; vertical-align: top; width: .25in;">
                        2
                    </td>
                    <td>
                        <div style="text-indent: 0.25in; margin-top: 0em; margin-bottom: 1em;">
                            &#8220;Give me my stick!&#8221; said Beaver. &#8220;I need it to build my dam!&#8221;
                        </div>
                    </td>
                </tr>
            </table>
            <table style="font-size: 12pt; font-family: Times; font-weight: normal;">
                <tr>
                    <td style="font-size: 12pt; font-family: Times; font-weight: normal; vertical-align: top; width: .25in;">3</td>
                    <td>
                        <div style="text-indent: 0.25in; margin-top: 0em; margin-bottom: 1em;">
                            &#8220;No! I need it to get apples down from this tree,&#8221; said Bear.
                        </div>
                    </td>
                </tr>
            </table>
            <table style="font-size: 12pt; font-family: Times; font-weight: normal;">
                <tr>
                    <td style="font-size: 12pt; font-family: Times; font-weight: normal; vertical-align: top; width: .25in;">4</td>
                    <td>
                        <div style="text-indent: 0.25in; margin-top: 0em; margin-bottom: 1em;">
                            Beaver was about to get grumpy when he stopped to think. Then Beaver smiled and
                            said, &#8220;I will lend you my stick if you will get some sweet apples for me too.&#8221;
                            So Bear knocked down a bunch of apples for them to share. From that time on, Beaver
                            and Bear got along just fine.
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>

Hello
Thanks for your request. On this case you should use the following HTML construction:

<div style="font-size: 14pt; font-family: Times; font-weight: bold;">
    <span style="font-size: 14pt; font-family: Times; font-weight: bold;">
        <center>Apples for Bear</center> <br /><br />
    </span>
</div>

Best regards,

Firstly thanks for quick response…
I have thousands of HTML files and i have to convert them to Word Doc, in this case your solution is not fesiable … have you any other work around for me
Thanks in Advance

Hello
Thanks for your request. The problem occurs because, currently, Aspose.Words does not support inheriting styles from parent elements.
Currently, Aspose.Words expects that font formatting is set in <span>, <i>, <b> or <u> element, formatting of paragraph – in <p> or <h1><h6> elements etc…
I linked your request to the appropriate issue, you will be notified as soon as it is resolved.
Best regards,

The issues you have found earlier (filed as WORDSNET-2021) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(17)