Android Question How is column width being set?

Tim Chapman

Active Member
Licensed User
Longtime User
In the example code here, how is the column width of the displayed table being set?
Thank you!
 

LucaMs

Expert
Licensed User
Longtime User
In the example code here, how is the column width of the displayed table being set?
Thank you!
The Sub LoadTable calls the method SetHeader of the Table class, which also sets the width of the columns.

The Table class also has the SetColumnsWidths method.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Is there a way I can set the column widths myself?
The Table class also has the SetColumnsWidths method.

1704091612276.png
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
The Table Class used in the demo program of the Read / Write Excel files on Android thread is a very very old one.
There does exist a more recent Class in the Flexible Table thread, which is an evolution of the Table Class.
The latest Class version is 1.44, this is the TableV1_44.zip project.
And then, the Table Class has become a CustomView and the latest version is 3.33 which is much more sophisticated.
But then, it depends on your expectations and needs for the Table.
The TableV1_44 Class supports automatic column widths adjusted according to the widest text in the column and horizontal scrolling.

Attached the ExcelExample project with the Table class version 1.44.
It needs following additional libraries:
SQL, an internal library you just need to check it in the Libraries Manager
ScrollView2D, an additional library, you need to unzip it and copy the ScrollView2D.jar and the ScrollView2D.xml files into the Additional Libraries\B4A folder.
Reflection, an additional library, you need to unzip it and copy the Reflection.jar and the Reflection.xml files into the Additional Libraries\B4A folder.
 

Attachments

  • ExcelExample1.zip
    27.6 KB · Views: 144
Upvote 1
Top