karnov / htmltoword

Ruby html to word gem
MIT License
177 stars 70 forks source link

Support for Merged Cell in Tables #49

Open ccelestial opened 7 years ago

ccelestial commented 7 years ago

I have an html to be converted to word doc:

<table align="center" border="1" cellpadding="0" cellspacing="0"> <tbody> <tr> <td colspan="2">Lorem Ipsum with Colspan 2</td> </tr> <tr> <td><strong>Lorem Ipsum</strong></td> <td><strong>Lorem Ipsum</strong></td> </tr> </tbody> </table>

It suppose to look like this:

screen shot 2016-10-21 at 3 01 09 pm

But in my document it appears to be like this:

screen shot 2016-10-21 at 2 19 58 pm

Does anyone have a solution for this?

frankvilhelmsen commented 7 years ago

the table seems to be fine,, maybe there is something external, css styles or otherwise.

ccelestial commented 7 years ago

I think the gem is not supporting the conversion of colspan of HTML to "w:vmerge" or "w:hmerge" of WordprocessingML.

ccelestial commented 7 years ago

@frankvilhelmsen I edited the description and added a screenshot of what I'm getting in my pdf conversion.

stats commented 7 years ago

You should be look at Tables.xslt which contains all of the code for styling tables. There is no vmerge or hmerge as part of the xslt. The tables code basically supports border properties and nothing else.

ccelestial commented 7 years ago

Hi @stats, that's also the file I referred that's why I saw that the gem aren't supporting vmerge or hmerge yet.

lukelex commented 6 years ago

@ccelestial I agree that this might be a good feature to have but since we don't use it we won't be investing time on it in the near future. BUT you're more than welcome to create a PR and we'll merge it.