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

Stop iText table from spliting on new page

I am developing an app for android that generates pdf. I am using itextpdf to generate the pdf. I have the following problem: I have a table that has 3 rows and when this table is near the end of a page sometimes it puts one row on one page and two…
Shura Capricorn
  • 119
  • 1
  • 9
3
votes
2 answers

Tablelayout with massive data android

What is the best way to create a table layout or recyclerview/listview/gridview in android that can pull a lot of data around 1000 rows and around 50 columns each row without to crash ? I want to show it like excel sheet nothing special just show…
user3341575
  • 65
  • 3
  • 8
3
votes
0 answers

How to create createDefaultTabView which return Image and text and set on TabView in short how to set Image & Text together on Custom TabView

//Like this want to return view with image and text TextView createDefaultTabView(Context context) { TextView textView = new TextView(context); int width = (int) (getResources().getDisplayMetrics().widthPixels / mViewPager …
3
votes
2 answers

Same effect on TableRow click as ListView click

I have a dynamic list view:
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
3
votes
1 answer

Set Imageview Height And Width Programmatically

for (int i = 0; i < rows; i++) { TableRow row =new TableRow(this); View v = new ImageView(getBaseContext()); TextView tv_main =new TextView(this); ImageView iv = new imageView(this); …
Tufan
  • 2,789
  • 4
  • 34
  • 52
3
votes
1 answer

How can i make Table layout rows scrollable In android?

I am using Table layout Inside scrollview it makes whole Table scrollable with header I want to make header non scrollable while Table rows will be scrollable how can i achieve that, table created pro-grammatically Here is my code
Aditi K
  • 1,534
  • 5
  • 22
  • 43
3
votes
4 answers

how to center table layout inside relative layout

I have a table layout that contain two edit texts and a spinner in each row, I want to center it inside a relative layout but I couldn`t get around it.
3
votes
2 answers

Button fill the whole row in TableLayout?

I have a LinearLayout in vertical orientation, in the first row I added one button which fills the parent. I want to implement the same thing using TableLayout. What I've tried so far is:
Caffe Latte
  • 1,693
  • 1
  • 14
  • 32
3
votes
2 answers

How to make TableRow right-to-left

How can I add views to TableRow right-to-left? the default mode is left-to-right. I tried android:gravity="right" and android:layout_gravity="right" inside both TableLayout and TableRow but didn't work. for example:
Soheil Setayeshi
  • 2,343
  • 2
  • 31
  • 43
3
votes
1 answer

How to avoid black screen when changing orientation of device in Android

I have one activity which has view-pager with 3 fragments, activity will always in portrait mode but if the user is viewing 3rd page(Fragment) and rotates the screen to landscape app will launch another activity in landscape mode and shows detailed…
3
votes
2 answers

Android TableLayout - equal width and equal height of cells - doesn't work, why

I have TableLayout and I would like to have buttons as cells. All buttons should have the same width. And all buttons should have the same height. (Weight and height will be different as I want to fill the screen). I was sure that I'm doing…
user2707175
  • 1,133
  • 2
  • 17
  • 44
3
votes
0 answers

Conflict with Android RadioGroup and tabular layout

I am working on a GUI that is defined by data from a webservice. One aspect is that I have a table structure of 2 columns and n rows. In the left column there are RadioButtons, in the right column EditText widgets. All the RadioButtons are logically…
3
votes
0 answers

TableLayout doesn't fit the screen

I am a beginner and I have designed a layout that displays the rows from the XML upon the click of a "show" Button. But when I don't click the show button, I want the table row with id-blank to increase its height to fit the screen. Please suggest a…
3
votes
2 answers

Gap between rows in tablelayout

I want to make a 6x6 tile-game. So I made a layout with 6x6 imageView, thought that would be easy enough. But no, I got spaces between rows and I've been trying for some time now to get them away but nothing seems to work. Here is my…
Jedi Schmedi
  • 746
  • 10
  • 36
3
votes
3 answers

Make cells same width and height to fill the table

I'm trying to learn how to use table layouts in android, this is my code:
BackSlash
  • 21,927
  • 22
  • 96
  • 136