I am now working on table using TableLayout to insert big data(long descriptions) in each column, as shown in the image. Because the description is too long in one column, all the words will misplace all the alignment run and the words cannot goes down the column.Any other way besides using TableLayout? The description in each column will be fetch from database.
Asked
Active
Viewed 167 times
0

Kleorence
- 23
- 5
-
can you show the screenshot of your existing layout – Vivek Mishra Oct 04 '17 at 11:55
-
Hi @VivekMishra updated my code. – Kleorence Oct 04 '17 at 11:58
-
I asked for screenshot though code was also required – Vivek Mishra Oct 04 '17 at 11:58
-
Hi, I have uploaded. – Kleorence Oct 04 '17 at 12:02
-
Just add bit of padding to your table row and follow this link https://stackoverflow.com/questions/6006899/force-textview-to-mutiline-without-n – Vivek Mishra Oct 04 '17 at 12:07
-
Thanks, will the description at each column goes down instead of going straight when i key in ? – Kleorence Oct 04 '17 at 12:09
-
If it will exceed that Max width it will shift to the next line – Vivek Mishra Oct 04 '17 at 12:11
-
Thanks @VivekMishra it works. Appreciate. – Kleorence Oct 04 '17 at 12:13
-
Also I would suggest to use adapters for this to make your code more dynamic – Vivek Mishra Oct 04 '17 at 12:16
-
Any example or link? And do you know how to add line between the table. because now it doesn't show line. – Kleorence Oct 04 '17 at 12:25
-
you can many examples for using adapters. What you have to do is create your dataset as a list and pass to adapter along with a listview or recyclerview component. For adding line between table simply add a view component after the row and give it 1 dp height and match parent width along with your desired color. – Vivek Mishra Oct 04 '17 at 12:28
-
Thanks. I try to key in the marks, but it cant be total up the final marks from each row. Do you have any tutorial on adding marks from each row and insert into db? – Kleorence Oct 04 '17 at 13:12
-
I have already told you using listview or recyclerview will be best for you for all cases. – Vivek Mishra Oct 04 '17 at 13:15
-
Yes I have take note. There are many tutorial out there and I am not sure which is the best. – Kleorence Oct 04 '17 at 13:17
-
try with androidhive tutorials. – Vivek Mishra Oct 04 '17 at 13:18