Forum


Replies: 24   Views: 10877
<li> with strictwordstyles = true
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by shroom  · 17-12-2015 - 23:25

>>It works, and I have not noticed any ill effects.

I take that back.  I did find a situation where it does have an unwanted effect.

So I'll ask again: Which line in HTML2WordML.inc would I need to modify to allow it to read inline styles for the <ul> itself?  Something like <ul style="margin-bottom:1em">.  Is that possible? 

Posted by admin  · 18-12-2015 - 08:14

Hello,

No, you can't set it to the ul because as explained previously, lists in Word are paragraphs with a style.

Maybe you could add other tag after the ul to set that margin-bottom or even apply this style to only the last li item.

Regards.

Posted by shroom  · 18-12-2015 - 14:49

>>Maybe you could add other tag after the ul to set that margin-bottom or even apply this style to only the last li item.

It is not feasible to add a style to the last listitem.  We have ~31,000 rows of data, with several hundred <ul>s and <ol>s.

I did find another workaround.  I added this to the default section of the switch statement in closePreviousTags():

if ($tag == 'ul' || $tag == 'ol') {
     self::$openBr++;
}

It works OK.  Not the best, but it will do..

Posted by admin  · 21-12-2015 - 07:33

Hello,

>>It is not feasible to add a style to the last listitem. &nbsp;We have ~31,000 rows of data, with several hundred.

We don't mean manually, you can do easily using PHP DOM and XPATH functions.

Regards.

Posted by shroom  · 21-12-2015 - 14:44

>>We don't mean manually, you can do easily using PHP DOM and XPATH functions.

I don't know how to do that.  Maybe I'll have to learn.