evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.14k stars 454 forks source link

Controlling table width #353

Open Md-Ala-Uddin opened 3 years ago

Md-Ala-Uddin commented 3 years ago

How to implement the logic so that table width expand to cover whole device with when table width is smaller than the device width, also available space equally distributed to columns & if table width bigger than the device width it will function as usual i.e. scrollable.

mamomia commented 3 years ago

+1

evrencoskun commented 3 years ago

Unfortunately, there is nothing in TableView that automatically resolves this for now. The TableView only calculates the minimum value the column should be. So if there is an empty area, it does not say that I may use it.

There is a way to solve this but you have to do it.

By taking the incoming column widths via getColumnWidth(int columnPosition), you can compare with the width of the TableView, check whether the case you have mentioned occurs, you can assign a width to the corresponding columns yourself using setColumnWidth(int columnPosition, int width)