EvotecIT / PSWriteWord

PSWriteWord is powershell module to create Microsoft Word documents without Microsoft Word installed...
MIT License
231 stars 34 forks source link

(Request) - Specify relative column width in Add-WordTable #5

Open PenguinPaws opened 6 years ago

PenguinPaws commented 6 years ago

When I add a table, I'd like to be able to specify the relative widths of each of the columns, such as: "30:50:20" for 30%, 50%, 20% of the 1st, 2nd, and 3rd columns. (Implicitly, I'm assuming "-autofit window" is used)

Thank you!

PrzemyslawKlys commented 6 years ago

Please check example 10 and new version 0.4.3. I am not sure if that's what you wanted and whether the expected values work correctly as is.

PenguinPaws commented 6 years ago

Awesome! Thank you so much :)

I can confirm that that's what I was trying to describe.

For quick ref for others, I used:

Add-WordTable -WordDocument $WordDocument -DataTable $qa -Design ColorfulGrid -Percentage $true -ColummnWidth 60, 30

Although I was just wondering, what is the meaning of the numbers in the "ColumnWidth" parameter, if I used the flag " -Percentage $false " instead?

Would that be pixels, inches, or centimetres?

PrzemyslawKlys commented 6 years ago

I would say it's Pixels.

image

But ... when I look at what Word shows when you go into propeties in each table in Word10 example I'm really not sure it works as expected. Did you get the 60/30 to be consistent for you? And according to your expectations?

PenguinPaws commented 6 years ago

I will test this in the next few days and let you know.