EvotecIT / OfficeIMO

Fast and easy to use cross-platform .NET library that creates or modifies Microsoft Word (DocX) and later also Excel (XLSX) files without installing any software. Library is based on Open XML SDK
MIT License
280 stars 50 forks source link

Change table width #29

Closed ExtremeKaos closed 2 years ago

ExtremeKaos commented 2 years ago

New feature: Looking for docs in https://evotec.xyz/docs/adding-tables-with-built-in-styles-managing-borders/, havent found a way to change width of table on/after creation. If doc margins change, table dont fill all documents width.

Is any way to do this using OfficeIMO ?

I will try to extend it by WordDocument.PublicMethods.cs, AddTable, if i dont miss something.

PrzemyslawKlys commented 2 years ago

Hi, I don't believe it's added yet. I guess one would add properties to WordTable class. There's already _tableProperties property, which would just need some expansion. I guess we also need AutoFit/Fixed or whatever that is called in Word to be possible for user to choose.

So AddTable can be extended, but WordTable class needs updates so that it's not just basic setting that you set when adding table but something you can do on Load as well.

PrzemyslawKlys commented 2 years ago