Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.
Sat Sep 24, 2022 2:00 pm
When trying to get the table width of a table into a slide.
Comparing time execution :
- Code: Select all
double initialTableWidth = 0;
for(var iCol = 0; iCol < iFirstDynamicColumn; iCol++) {
initialTableWidth += table.getColumnsList().get(iCol).getWidth();
}
is so much better than :
- Code: Select all
double initialTableWidth = table.getWidth();
For the same result...
-
QuentinSup
-
- Posts: 47
- Joined: Mon Oct 18, 2021 9:18 am
Mon Sep 26, 2022 8:01 am
Hello,
Thanks for your inquiry.
This first code you provided is to calculate the originally defined width of the table, but the second code is to calculate the actual width of the table (considering the situation that the table is stretched by text). Therefore, the executing time of the second code is longer than the first code.
If you have any issue, just feel free to contact us.
Sincerely
Abel
E-iceblue support team
-
Abel.He
-
- Posts: 1010
- Joined: Tue Mar 08, 2022 2:02 am