Hello,
The replaceTableVariable and replaceVariableByText methods don't change the tablet widths, unless you use an option or style that change or remove them. Please check which options are you using and if you are adding some style that set new styles; some methods and options changed from the old phpdocx 3.7.
If you send to contact[at]phpdocx.com your DOCX template and the smallest script that illustrate your issue (without external connections such as databases or web services), we'll check it. Some method or option must be wrong in the script you are running.
Regards.