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
15
votes
1 answer

android:stretchColumns

I guess I just havent found a good explanation here. So can anyone please tell me what android:stretchColumns actually does? I have it in my table and have tried several different values but cannot seem to figure out what it is doing. Sorry for…
Mark Worsnop
  • 4,407
  • 15
  • 54
  • 79
15
votes
6 answers

Android TableLayout Header row

Okay, so I've got this TableLayout, and its full of data - with all of the rows added programmatically. I've got the TableLayout inside of a HorizontalScrollView, which in turn is inside a ScrollView - this gives me scrolling both horizontally and…
Jeff Barger
  • 1,241
  • 1
  • 13
  • 19
14
votes
4 answers

Adding space between columns of a TableLayout

I have a TableLayout where I add dynamically TableRows. In each TableRow, I add a Button. I just would like to add some space between my columns (which are my buttons) but I can't figure out how... I've tried to change all the possible margins but…
Nico
  • 6,269
  • 9
  • 45
  • 85
14
votes
1 answer

Is it possible to bind a TableLayout with a ArrayAdapter?

Is it possible to bind a TableLayout with a ArrayAdapter?
Manish Khot
  • 3,027
  • 2
  • 29
  • 37
14
votes
2 answers

Android responsive layout

I am building application (calculator). I use table layout with buttons inside. It looks perfect on screen of Samsung Galaxy II, however it looks very bad on bigger screens. The buttons hight is very small. How I can stretch the buttons on bigger…
Jacob
  • 1,135
  • 5
  • 14
  • 29
13
votes
3 answers

TableLayout with layout_width=matchparent not matching parent

I have a tableLayout with two columns and two rows, both rows and the last column have match_parent for width but the layout isn't filling the parent width, it comports itself like it had wrap_content. Here is the code:
jonathanrz
  • 4,206
  • 6
  • 35
  • 58
12
votes
2 answers

How to dynamically create columns in a tablelayout?

I'm trying to get an understanding of how to dynamically add columns and rows to a tablelayout. I have this simple example. However, it only shows the first column when ran. Can someone tell me what is missing in order to display four columns…
L. D. James
  • 1,679
  • 1
  • 22
  • 35
12
votes
3 answers

How to show image in table row based on size

Have 2x2 grid(Dynamic using TableLayout) need to show image on that. now based on image size, means-- if image fit for 1 cell means 1 cell,else big means 2 cells or 4 cells based on size( I know how many cells it will occupy) i can show image in 1…
user4302606
11
votes
1 answer

How to set Table Column in android

I am having some difficulty setting layout parameters of table rows (containing text views). I want to add some columns to get a good layout. I am doing it dynamically. (in code)
abhishek ameta
  • 2,326
  • 7
  • 28
  • 35
11
votes
4 answers

How to make perfect square shaped image/button

I am designing a basic sudoko GAME for android. I want a 4x4 table with all cells as squares in it. I am trying this with the 16 Buttons in a TableLayout. My way looks like this they are rectange in shape :( my…
Maveňツ
  • 1
  • 12
  • 50
  • 89
11
votes
3 answers

Android Table Layout Alignment

I am using Table Layout to display data as shown below. What i want to do ? I want the Text in the second column to be aligned to the left and the text should wrap and be displayed in the next line and over flow as you see in the image. Code: …
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
10
votes
3 answers

Android TableLayout With Different Column's Width In A Row

I am trying to do my first complex GUI, but now i can't to solve this problem. The first column of the first two rows only needs to contain the label, while the second column of the first two rows must occupy the remaining space. In this snapshot…
paolo2988
  • 857
  • 3
  • 15
  • 31
10
votes
1 answer

TableLayout weight sum issues

I'm trying to implement a 40/60 percent split in my TableLayout but I'm having no luck. When testing the code on my Android Device the left TextView still takes up what looks like 60%, instead of 40%.
10
votes
3 answers

Border Lines for cells in GridLayout, TableLayout, or GridView?

I am trying to create a table/grid for some items within my app and I would like to have a border around each cell to divide the items up and have a coherent association of the setting with the item. This app will be used in an industrial setting…
10
votes
3 answers

how to align item in table row (left - center - right)

I'm trying to align items in a table row (left/center/right positions), but i could dot get it work can someone help me looking at below snippet,,, Table Row should align to textview1 = left textview2 = center imgview1 = right xml for table…
Sam
  • 6,215
  • 9
  • 71
  • 90
1
2
3
81 82