mwilliamson / python-mammoth

Convert Word documents (.docx files) to HTML
BSD 2-Clause "Simplified" License
811 stars 121 forks source link

Add support for formatting of tables #79

Closed ageheim closed 3 years ago

ageheim commented 5 years ago

Hi, and thanks for doing a great job! As for now, formatting of tables is ignored. Do you have plans on implementing such feature or can you give a hint where to start if I want to give it a try myself?

My situation is as follows: I have a large number of doxc files, all of them with at least three tables, all of them is presented differently regardning borders on either cell or table. Additionally, some tables have different width's, depending of content type. My solution today is to, as you describe, use css to style the tables (each table gets an id from a python script). Somtimes, when adding a new table for instance, the id changes for a table and I have to alter the css-file accordingly. And with about 400 tables, it's quite a job to do..

Best regards

mwilliamson commented 3 years ago

If you assign an appropriate style to the table, you should be able to use style mappings to map from the Word style to an appropriate CSS class.

ahsanshakil9700 commented 1 year ago

Can anyone write a sample style map for adding borders to a normal table created using word. I can't seem to understand that

rajeshpyne commented 1 year ago
....