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
3
votes
2 answers

Android - Dynamically Adding TableRow to TableLayout using an existing TableRow layout

I'm trying to adding TableRows to a TableLayout, which is working fantastically. However, I'm running into some problems with layout parameters. The spacing between the TextViews within a TableRow isn't working out like I thought it would. My…
Jason L
  • 1,812
  • 2
  • 22
  • 43
3
votes
2 answers

ScrollView doesn't display whole TableLayout

I want to display a TableLayout within a ScrollView. The Table has 9 TableRows but the ScrollView starts displaying parts of the 4th row and I can't sroll up to see the rows above. The XML-Layout:
3
votes
1 answer

implement android:stretchColumns="*" programmatically in Android

I am working on an application that implements the aforementioned property in the TableLayout. I was wondering could anyone please help me and show me how to do this programmatically and not in the layout file?
user788511
  • 1,726
  • 2
  • 30
  • 52
3
votes
1 answer

How to get click event of table row/ table item?

I have a simple table layout in the .xml file. I am adding components to it at run-time. Following is my code: public class Home extends Activity{ TextView tv1; int i;TableRow tbrow; String [] names = {"First Name","Last Name",…
PrincessLeiha
  • 3,144
  • 4
  • 32
  • 53
3
votes
2 answers

TableLayout Tweak. Is it possible?

I have a table layout with five columns and many rows with dynamic content. We notice that each column takes the width of the maximum of all cells of that column. I do not want horizontal scrolling but I want to detect when the total width has been…
Sherif elKhatib
  • 45,786
  • 16
  • 89
  • 106
3
votes
1 answer

Rows added to table are not showing up

This has been asked before, but I have found no solution that worked for me yet: When adding rows to a table from code, the rows are not showing up in the application. There is one row I specified in XML, that one is showing up, but nothing below…
Lars
  • 523
  • 1
  • 6
  • 20
3
votes
1 answer

Radio group in table layout with radio buttons aligned to columns

I am developing a feedback application which should has similar layout to this screen. [1]: https://i.stack.imgur.com/xn3kh.jpg I have designed the xml for layout.
Zankrut Parmar
  • 1,872
  • 1
  • 13
  • 28
3
votes
1 answer

TableRow's column changes its size

I am trying to make an XML file for Android remote control. I have used TableLayout As you see from the screenshot the column changes its size (but all images have the same size). The problem is only with that row. Here is the link to my code (can…
abrutsze
  • 496
  • 1
  • 8
  • 24
3
votes
2 answers

TableLayout going out of screen

I can't make my Android TableLayout works, it's going out of the screen. I tried layout:weight and android:shrinkColumns="*". My xml:
Maciek
  • 45
  • 5
3
votes
1 answer

Adding TableRow Dynamically to TableLayout in xml

Although this looks a lot repeated question but first time for me. I searched all over and could not get the result and ended up posting here. I am creating a table dynamically of which the TableLayout part is written in xml part.
3
votes
2 answers

Android: draw xml Layout on canvas

I have a custom PrintDocumentAdapter and draw pages on my own, so I should draw xml layout on the page canvas: private void drawPage(PdfDocument.Page page, List objects, int pageNumber) { Canvas canvas =…
Mneckoee
  • 2,802
  • 6
  • 23
  • 34
3
votes
4 answers
3
votes
2 answers

TableLayout of radiogroup(s) with respective label(s) aligned in android

I'm creating a feedback input form which takes user selection from radio buttons just like below image. So i took a table layout and added table rows with textviews of fixed width in first row and a textview with radio buttons of fixed width for…
3
votes
1 answer

How to set TableRow width to max in Android?

I have a table defined in .xml file but rows and headers have to be added dynamically. I have a problem with fill width with table row on horizontal and vertical orientation. I have tried stretchColumns parameter but it did not help. What is the…
Sheppard25
  • 493
  • 1
  • 7
  • 22
3
votes
1 answer

How to set columns programmatically to have dynamic with in Android?

I have created a table like this: TableLayout table = new TableLayout(getApplicationContext()); table.setColumnStretchable(1, true); table.setColumnStretchable(2, true); tableRow = new TableRow[20]; tableRow[i] = new…
Alex Mamo
  • 130,605
  • 17
  • 163
  • 193