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
5
votes
4 answers

How can I get a reference of a view from a inflated layout

I have a huge layout for my activity that i set using setContentView(). In that layout I have a TableLayout(named tableLayout in my Activity) that I want to populate. The rows of that TableLayout are customViews in a layout file(let's call that file…
Felix
  • 159
  • 2
  • 3
  • 13
5
votes
1 answer

Tablayout update page title of custom view tabs

I made a tablayout tabs, which has custom layout for tabs, Sometimes I wish to change the title of those tabs. but I don't get right way of doing it, kindly help me. my custom_tab.xml
5
votes
3 answers

Android: Allow margin/padding in TableLayout to give some separation between widgets

I have defined six buttons in TableLayout as:-
Vinit ...
  • 1,409
  • 10
  • 37
  • 66
5
votes
1 answer

Android: create square cell table

I am designing a basic tic tac toe game for android as my 'Hello World' project. I want a 3x3 table with all cells as squares in it. The way I've done makes the column shrink if there is nothing in any of the cells in it. I am trying this with the…
Harshad Kale
  • 17,446
  • 7
  • 30
  • 44
5
votes
0 answers

TableRow fill remaining space

I have a layout like the following:
Jutanium
  • 421
  • 3
  • 16
5
votes
1 answer

How to set weight of tablerows elements?

I have a TableLayout which I add rows programmatically and I'm trying to set "weight" of elements contained in rows programmatically. I'm trying to do that by setting weightSum on the TableRow and setting "weight" of the columns using the last…
user2420692
  • 51
  • 1
  • 1
  • 2
5
votes
4 answers

TableRow not wrapping TextView

TableLayout has a TextView and EditText on each row. When EditText has a multiple row, TableRow wraps it but when TextEdit, it doesn't.. Simplyfied layout:
hkutluay
  • 6,794
  • 2
  • 33
  • 53
5
votes
3 answers

Can't get rows in TableLayout to center horizontally

I can't get the rows in my TableLayout to center on the screen. I'm trying to create a 4x4 table of clickable images and want them centered on the screen. It ends of drawing them left aligned, I would like them to be centered with space on either…
bieno002
  • 405
  • 1
  • 5
  • 12
4
votes
3 answers

Expand last row of TableLayout

I have a TableLayout with about 3 rows. I'd like to get the last row's height to fill in the rest of the View, but not having much luck (since working with Android layouts is a lesson in futility). This is what I have so far:
Kris B
  • 3,436
  • 9
  • 64
  • 106
4
votes
0 answers

Programmatically set border for TableRow's array

I've never seen a question as mine. How can i set a TableRow.LayoutParams with array of TableRow? This is an example of code: for (int i = 0; i < 3; i++) { tvName[i] = new TextView(this); tvName[i].setText("Test"); } row = new…
Aerox
  • 669
  • 1
  • 13
  • 28
4
votes
3 answers

Android TableLayout programmatically

I learned how to create UI using XML file.But please help me to know how to do it programmatically without using XML files especially for other than LinearLayout.
RAVITEJA SATYAVADA
  • 2,503
  • 23
  • 56
  • 88
4
votes
2 answers
4
votes
3 answers

Android TableLayout width issue

I'm using TableLayout to display data. Text of the TextViews of the right column will be set when activity calls onCreate(). Now, as you can see in the following image that my address text can be long and it should be wrapped. So I set…
Vikas
  • 24,082
  • 37
  • 117
  • 159
4
votes
2 answers

Android spread TableLayout across page

I'm trying to make my TableLayout spread across the whole page. Right now all TableRows are "pushed" against each other. But I want them to be further apart. Situation now: What I want to achieve: Activity.java (added this because I'm adding…
Guido
  • 1,161
  • 3
  • 12
  • 33
4
votes
4 answers

TextView content inside a Table Row gets cut off

Firstly, I did a Google search and looked at StackOverFlow questions related to text being cut off for TextView. They did not help to solve the problem at hand, though they provided better understanding of certain things. Here is my problem. I am…