Questions tagged [android-tablelayout]

The TableLayout is one of the layouts on the Android platform that arranges its children into rows and columns.

The TableLayout arranges its children into rows (the number of rows is given by the number of direct children, usually TableRows) and columns (where the number of columns is given by the TableRow with the biggest number of views in it).

Normally TableLayout consists of multiple TableRow objects, each defining a row. Each row has zero or more cells and each cell can hold one View. Cells can span over multiple columns. The width of a column is by default defined by the widest view in that column.

The TableLayout can also specify various rules to modify the way the columns use the space available to them (or even make them disappear). When using the TableLayout, care must be taken regarding the LayoutParams used as the TableLayout, which imposes some constraints on its children. More information can be found in the documentation for the TableLayout class.

This is an Android specific class, not present in JavaSE.

1224 questions
4
votes
2 answers

Border for table row items in android

How i can achieve view like below screen shots (1 expected result, 2 Actual result). As you can see each items have border it is like left and bottom for some items and for some items it is right & bottom. I have created view using TableLayout but…
Wasim K. Memon
  • 5,979
  • 4
  • 40
  • 55
4
votes
1 answer

Floating Action Button wrong position in TableLayout

As you can see TableLayout changes width of Button , ProgressBar and EditText components, but does not do the same for my FloatingActionButton. Here is a photo that explains my problem The result i want to get In xml:
4
votes
1 answer

Scrollable rows with fixed static header using TableLayout in android

I am working on an android application where I want to display the data into TableLayout from database. In this TableLayout, the column headers are fixed in vertical scrolling but should be scrollable in horizontal scrolling. I have done this so…
Suniel
  • 1,449
  • 8
  • 27
  • 39
4
votes
1 answer

OnClickListener on dynamic table layout

I want to add onClicklistener to the items from the dynamic table that is generated. My Code is for(int k=0;k
Sukan
  • 346
  • 1
  • 3
  • 19
4
votes
5 answers

How to create a pagination for dynamically created table layout using set visible?

I am getting data from server and create the tablelayout dynamically for that response, now I need to show only 5 rows per page, I am using setvisible(view.invisible) to hide all the table rows, How to set the 5 rows setvisible(view.visible) to show…
Strawberry
  • 667
  • 2
  • 10
  • 24
4
votes
2 answers

How to create table row and column border from programmatically in android

I follow this How can I create a table with borders in Android? Which is very helpful, but unable to create column border only row border displaying in my case. My code: TableLayout.LayoutParams tableLayoutParams = new …
No_Name_Code
  • 299
  • 10
  • 20
4
votes
1 answer

Distribute rows evenly over the height of a TableLayout

TableLayout contains the handy attribute android:stretchColumns="*" to distribute column width evenly over the size of the table. Can the same be done for rows?
Maarten
  • 6,894
  • 7
  • 55
  • 90
4
votes
1 answer

dynamically added rows in tablelayout are not visible

i have a table with header row designed in xml. Now i want to add data in the table ( which i get from json array). I need to scroll data rows vertically without affecting header row, so i created another tablelayout just below the table of header…
HimanshuR
  • 1,390
  • 5
  • 16
  • 35
4
votes
6 answers

Cursor is not visible in EditText when view is dynamically added

I have a TableLayout and dynamically view is added in the layout. Whenever layout has a EditText cursor is not visible on EditText but it cursor is visible on top of the EditText which is TextView. I added onClick event, XML file for both Edittext…
Megha
  • 1,581
  • 2
  • 18
  • 33
4
votes
4 answers

Setting onClickListener to TableRow with TextViews

Good day to all. I have a TableLayout with three TextViews in each of its rows. Is it still possible to add OnClickListener to the whole row? I'd like to change the background colour of the selected row. I've set an OnClickListener to the…
ClaireG
  • 1,244
  • 2
  • 11
  • 23
4
votes
2 answers

TableLayout inside a Fragment

I am creating a Fragment that will dynamically create a tableLayout but I am having problems with it as it is not being displayed. Can someone tell me why it is not displaying? The section label can be displayed except for the table. Here is my…
jantox
  • 2,185
  • 4
  • 21
  • 22
4
votes
1 answer

Add column to table programmatically

I have some trouble to add columns to a table programmatically, maybe I look/search for the wrong keywords, but can't find a proper solution. I got this code: ScrollView sv = new ScrollView(this); TableLayout ll=new TableLayout(this); …
Bigflow
  • 3,616
  • 5
  • 29
  • 52
4
votes
2 answers

(TableLayout)findViewById( null pointer exception

I search for answer all day long, but when i try to get the table layout i am having null. I found info that it may be another table layout with same name, but there is only one. My .xml file : my xml and my code is here layout6 =…
4
votes
1 answer

Different layouts for different groups in a Expandable ListView

I need to use an expandable listview in my application, where each group has different Table Layouts. And i want to set onClick Listener to each rows in the table. How is it possible to set different layouts to different groups in a expandable…
Raneez Ahmed
  • 3,808
  • 3
  • 35
  • 58
4
votes
3 answers

How do I get values from a dynamically created android TableRow?

I used the code below to create a TableRow with content dynamically. It works good but I wish to get the values in the TableRow. Here is the sample code (I got it from Google), it has two text values in the TableRow. When I click the TableRow at any…
Aerrow
  • 12,086
  • 10
  • 56
  • 90