difference between grid and table layout?

1,381 views
Skip to first unread message

eos

unread,
Sep 7, 2013, 9:37:10 AM9/7/13
to codenameone...@googlegroups.com
Hi, want to create a 3 column table like thing with a solid background and a line between each row (could be part of a background for a row.

I don't want to use a normal table as its too hard to use anything other than the default text only model (I need to add a graphic) and there is not much in the way of example code.

So I plan to use a Box Y layout to represent rows, and in each row position do a border layout with the row data in Center, and the horizontal rule in the S position.  Then in the center have something with fixed widths columns which I can control so I can make the columns line up.    

would the grid layout or the table layout be better for this?  What is the difference between them?

Ideally I need to make some columns centered, and some left justified, which is not possible with a simple table model.

Thanks!

Shai Almog

unread,
Sep 7, 2013, 1:21:35 PM9/7/13
to codenameone...@googlegroups.com
Hi,
You can make cells centered or left aligned in the table layout using the constraint option.

Grid creates an equal grid of components where the width/height of all the elements is 100% identical. So getWidth/Height for all elements in the grid will be exactly the same (when adding the margin too).
Reply all
Reply to author
Forward
0 new messages