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

How to divide the table layout into equal parts vertically?

I am new in android and had a query. I am creating a layout with table in it. I have linear layout as main layout and 3 child layout of which i have divided them using layout weight. Now my problem is that how can i divide the table layout in my…
3
votes
1 answer

Best way to create a UI table in Android

I'm trying to design a table UI for my activity. I would like three columns and a fixed number of rows (so that the view fill all allotted space). Each of the cells should be clickable, and able to host standard widgets such as textview of buttons.…
3
votes
0 answers

Android: Insert TableRow into TableLayout in between TableRows dynamacally

In my application four or five row is there which I dynamically inserted into TableLayout. In the third row one button is there which capture the photo and then it show this photo just below to the button. In this application I am also removing…
Vinit ...
  • 1,409
  • 10
  • 37
  • 66
3
votes
3 answers

How to put a very long table layout inside the horizontal Scroll view in the CORRECT way?

I tried looking at numerious examples and posts but none of them matches my problem. I need to make a very long (horizontal) table with many columns so it is impossible to display in a single screen. And I don't want to spilt the table because it is…
jbchichoko
  • 1,574
  • 2
  • 12
  • 16
3
votes
2 answers

Android - Custom cells for tableview in android

I want to implement a table with one column, or maybe a list in Android. I would like to customize the cells. Do you know some tutorial that can help? Thanks in advance, Luda
Luda
  • 7,282
  • 12
  • 79
  • 139
3
votes
2 answers

How to get the row id of a particular selected row?

I have added two TableRows to TableLayout that is in a for loop. In every first TableRow there are 6 TextViews and 1 ImageView & 1 Toggle Button. I have added an OnClickListener to the first row & Toggle Button. My question is in the onclick method…
Geetha
  • 39
  • 1
  • 5
3
votes
3 answers

Table in Android

In my Android application there is a screen with some data to be displayed in table format. This table will have around 5 columns and at least 50 rows. How do I do I create a table in android? I searched through and everybody seems to recommend to…
Nini
  • 43
  • 5
2
votes
1 answer

TableLayout row strech/shrink

I'm trying to fit a 20x20 table into a view using a programmatically built TableLayout. The setStretchAllColumns/setShrinkAllColumns methods work perfectly for squeezing all the columns in, but I haven't found a way to get all the rows in. Is there…
Andrew Prock
  • 6,900
  • 6
  • 40
  • 60
2
votes
1 answer

Error in Adding radiobuttons to radiogroup in tableLayout in android programaticall/dynamically?

RadioGroup rg = new RadioGroup(this); for (int i = 0; i < e.length(); i++) { JSONObject arrayElement = e.getJSONObject(i); TableRow newRow = new TableRow(this); …
2
votes
1 answer

Problems with dynamically adding TableRow in TableLayout

My code: public class Test extends Activity { private TableLayout tableLayout = null; private Button add = null; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); tableLayout =…
zapotec
  • 2,628
  • 4
  • 31
  • 53
2
votes
2 answers

Align table rows vertically inside table to cover-up entire area

I have a table that covers-up entire screen and contains variable number of rows. I would like to know how can i distribute these rows vertically uniformly, so that they take up entire tables' space. I have tried layout_weight, and weightSum, but…
Nitin Bansal
  • 2,986
  • 3
  • 23
  • 30
2
votes
2 answers

Android : Unable to set TableLayout properly as wanted

I am showing data from DB in an Activity. I want a Table and buttons on bottom. For data thought TableLayout would be best option for it. I added TableLayout to HorizontalView & to ScrollView making it scroll vertically & Horizontally. Am adding all…
Tvd
  • 4,463
  • 18
  • 79
  • 125
2
votes
1 answer

When activity comes from background to foreground, text layout of buttons suddenly ranges from top to bottom

I keep track of a very strange behavior. One part of my layout produces these buttons: This is the corresponding layout:
Bevor
  • 8,396
  • 15
  • 77
  • 141
2
votes
1 answer

How to do fastScrolling on tablelayout in Android

I have tableLayout filled with a lot of rows (in xml). I wrapped it in a scrollView and it scrolls great. However I'm trying to get the fastScrolling feature to work (the slider bar on the right) and saying android:fastScrollEnabled="true" for both…
ghostbust555
  • 2,040
  • 16
  • 29
2
votes
1 answer

android marquee not working

Marquee is not working in textview.I placed the textview inside the TableLoyout between two buttons. And i make the textview as stretchable column. Here is my xml code. I cant figure out the mistake.
Srini2k6
  • 380
  • 1
  • 5
  • 19