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

Dynamically Populate Data for Android Table Layout

I am trying to load the data retrieve from SQLite database into Android tableLayout. Here is my code: TableLayout table_layout; private SQLiteDatabase mDb; @Override protected void onCreate(Bundle savedInstanceState) { …
user2424370
6
votes
1 answer

How to zoom Android TableLayout

I'm making a gomoku game for Android in Java. I've created a scoreboard in the top of the activity and a new game Button in the bottom. In the center, I've created 100 ImageViews (10 rows and 10 columns) in a TableLayout. It works fine in tablets,…
racz16
  • 198
  • 2
  • 8
6
votes
1 answer

Programmatically set border for TableRow array

I know it is the same question as here But it hasn't receive an answer yet, so I try it here, becuase I need it too :) I got an Array: (I shortend the array/code for SO) ScrollView sv = new ScrollView(this); TableLayout ll=new…
Bigflow
  • 3,616
  • 5
  • 29
  • 52
6
votes
2 answers

Is it possible to specify TableRow height?

I have a TableLayout with multiple TableRow views inside it. I wish to specify the height of the row programatically. E.g. int rowHeight = calculateRowHeight(); TableLayout tableLayout = new TableLayout(activity); TableRow tableRow =…
Chris Knight
  • 24,333
  • 24
  • 88
  • 134
6
votes
2 answers

Android tablelayout row padding

I want to create a table with buttons on the right of the rows as shown below. I want to set padding for the right of each row but this "eats into" the right most button. Is there a way of having the padding without compromising the display of the…
user745229
6
votes
4 answers

How to set android table layout Column padding in xml

I managed to design the layout using TableLayout. android:layout_span helped me on that. The problem is I need some gap between Column1 and Column2. In either way Padding / Margin I am not prefering program for this task. there must be a simple way…
Mahendran
  • 2,719
  • 5
  • 28
  • 50
6
votes
1 answer

Views added to TableLayout programmatically not showing

I'm trying to add views to a TableLayout, but they simply won't show up (I'm testing on an emulator). Actually I wrote more code than this, i.e. adding textviews to tablerows, but I've cut it down to this, and even this won't work. Any idea…
gosr
  • 4,593
  • 9
  • 46
  • 82
5
votes
1 answer

Populate TableLayout with android:layout_weight programmatically

I am trying to populate a tablelayout with cells and rows stretches to fill the whole screen. Like this: http://imageshack.us/photo/my-images/69/device20120201005942.png/ This layout designed in Graphical Layout window in Eclipse gives what I want…
volkan
  • 153
  • 2
  • 11
5
votes
5 answers

GridView or TableLayout?

http://img683.imageshack.us/img683/645/weatherscreenmockupoutl.png I am asking myself whats the best way to code this layout. Basicly i just need to know how to get seven columns with an equal width. Thanks in advance!
5
votes
0 answers

Zoom on Tablelayout

I create TableLayout. In the TableLayout I create dynamic row and add Number of Button on table row. OnTouchListener apply on the Button for zoom in and zoom out. When I move my finger slowly zoom in and zoom out work fine but when my finger…
5
votes
2 answers

TableLayout Crashing application on android Lollipop

I am using TableLayout in one of my activity layout. but when I am trying to run same activity on the Lollipop it crashes. It works perfectly on Marshmallow and Nougat. When I tried to run it after removing TableLayout(ONLY) it worked fine in…
parish
  • 846
  • 2
  • 18
  • 32
5
votes
1 answer

Android Creating Table Programmatically

I am trying to generate a number table with given row and column number. The program takes two parameters from the user and creating a table rows and columns with given parameters. Each cell is going to have a random number value between 1 to…
rawsly
  • 372
  • 1
  • 5
  • 20
5
votes
2 answers

Android: how to disable swiping between tablayout control by button click

i have 2 fragment in my tab layout, i manage to disable the swiping function between tab layout by button click. How to implement the disable function in my onclick button. thanks for advance MainActivity public class MainActivity extends…
AnthonyTang
  • 89
  • 1
  • 1
  • 9
5
votes
3 answers

How to create exactly square buttons that fill in width of screen

I've an activity that fill with some buttons dynamically base on TableLayout and TableRow like this: private TableLayout buttonTableLayout; //----- for (int row = 0; row < buttonTableLayout.getChildCount(); ++row) ((TableRow)…
Beppe
  • 201
  • 1
  • 2
  • 13
5
votes
1 answer

2 dimensional scrolling chart for Epg or some schedule in android

I will share my diagram for the screen first. Diagram of the screen Each cell Pij represents a program scheduled for the channel Ci in the leftmost channel column which should scroll vertically with the grid. It also corresponds to timeline,…