B4A Code Snippet [B4X] B4XTable - Resize columns based on content - Erel    Apr 01, 2020   (8 reactions) This code measures the required width based on the cells text and set it:
Sub B4XTable1_DataUpdated
Dim ShouldRefresh As Boolean
'NameColumn and NumberColumn are global B4XTableColumns that we want to measure
For Each column As B4XTableColumn In Array(NameColumn, NumberColumn)
B4A Library [B4X] B4XTable - Cross platform, sortable, searchable, customizable table - Erel    Feb 08, 2024   (58 reactions) You can set this field to False to prevent this. This is mainly useful if you are using custom cells and want the heights to be static.
V1.03 - Search term highlighting. Color is configurable with the designer.
- PrefixSearch field - limits searches to prefix matches.
- Better support for table resi B4i Question B4xtable: resize according to the width of the screen - Alexander Stolte (first post)    Nov 05, 2023   (2 reactions) dont use %x or %y outside the designer.
Erel said you can also use it in the resize event, but never outside. B4J Question B4XTable FrozenColumns at right? - PaulMeuris (first post)    Mar 06, 2023   (1 reaction) The resize subroutine works because the B4XTable view is anchored in the layout.
And if you don't use fixed column widths then the B4XTable class takes care of the recalculating of the column widths.
So this code also works:
' Column1.Width = 150dip
' Column2.Width = 180dip
' Column3.Width Wish [B4X] Resize B4XTable columns based on content, title included - LucaMs    Jan 02, 2024   (1 reaction) With reference to the following snippet:
B4XTable - Resize columns based on content
I wanted the column width adjustment to also include the header.
I would suggest to replace that snippet with the following Sub:
Public Sub XTableDataUpdated(XTable As B4XTable, TitleIncluded As Boolean)
Dim B4J Code Snippet B4XTable Column Resizing... (works for me) - Magma    Jul 08, 2022   (6 reactions) :)
Here a Video to see - how works... old-video now all working !
3Jh0G71RFDg
Is totally open-source - and ofcourse you can always donate me and B4X too.. Please share your code too... to make b4xtable stronger !
Credits to: Erel, LucaMs, Mahares, aeric...
⭐ You can donate me (buy me a coffee, B4J Question B4XTable - Problem with Resize Screen - EnriqueGonzalez (first post)    Oct 11, 2020   (1 reaction) you should use anchors for this
https://www.b4x.com/android/forum/threads/b4x-anchors-demonstrated.64112/#content
but may be you are using them and may be for some other reason they are not working, if that is so you can use the mainform.rootpane resize event. (if you are in the mainform of course) Wish B4XTable user resizable columns - aeric    Mar 21, 2022   (1 reaction) I wish this is possible one day.
https://www.b4x.-resizable-columns.110154/
and if possible double click the divider to auto resize to fit the content like excel. As I know, TreeTableView has these features. B4J Question How To Set B4XTable Column Width By Percent of Parent Container - Erel (first post)    Nov 25, 2021   (4 reactions) https://www.b4x..gif
The trick is to put the table inside a panel and handle its resize event:
Private Sub TableParent_Resize (Width As Double, Height As Double)
col1.Width = B4XTable1.mBase.Width * 0.2
col2.Width = B4XTable1.mBase.Width - col1.Width - 2dip
B4XTable1.Refresh
End Sub B4J Question Sort by date value in TableView - Erel (first post)    Nov 27, 2019   (1 reaction) Not with dragging. However you can resize the columns to fit the content. B4XTable is page based. Note that it has many other features that are not supported by TableView (searching, sophisticated sorting, filtering, better support for custom cells and custom behavior). And it is cross platform. Page: 1   2   3   4   5   6   7   Powered by ColBERT |