Hallo,
I've got a question concerning the column width of tables and its assignment with "collect style putdocx". I understand that the sum must be equal to 100. However, even if the sum does equal 100, in some cases I get error messages implying that this is not the case.
Are there any rules to be considered, when defining column width?
What do I do: I generate a series of tables with table/collect layout and arrange them one below the other. The tables may have a different number of columns. However, the first column (with labels) and the second columns should have the same width. The other colums may vary in width.
I define several vectors "width#" to set the width of each table. However, sometimes it is pretty difficult to find a vector which is working. The slightest change will result in the procedure either working or not. I don't really understand why this is the case.
Thanks a lot!
I've got a question concerning the column width of tables and its assignment with "collect style putdocx". I understand that the sum must be equal to 100. However, even if the sum does equal 100, in some cases I get error messages implying that this is not the case.
Are there any rules to be considered, when defining column width?
Code:
clear all
set more off
sysuse auto.dta
putdocx begin
table foreign rep78, statistic(freq) statistic(sumw) statistic(percent, across(foreign)) ///
sformat("%s%%" percent) nformat(%9.0f) totals(foreign)
* does work
*mat width1 = (37, 15.5, 9.5, 9.5, 9.5, 9.5, 9.5)
*mat width1 = (37, 15, 9.6, 9.6, 9.6, 9.7, 9.5)
* does not work
mat width1 = (37, 15, 9.6, 9.6, 9.6, 9.6, 9.6)
collect style putdocx, halign(left) width(80%) width(width1)
putdocx collect
putdocx save test, replace
Code:
. putdocx collect
option width() specified incorrectly
The sum of the column widths specified in matrix width1 must be equal to 100.
I define several vectors "width#" to set the width of each table. However, sometimes it is pretty difficult to find a vector which is working. The slightest change will result in the procedure either working or not. I don't really understand why this is the case.
Thanks a lot!

Comment