I use table layout for for display data as table .But i want table with userdefined columns and rows with borders.Give me suggestions?
The Android developer site contains great documentation. You can find information on table layouts here. The easiest way to learn is of course to pick-up a good book on Android and experiment.
I have to agree with Brad. That was an awful answer. The Android documentation states that TableLayout containers do not display border lines, so sending them to the Android site wont help them a bit. I was able to find a "dirty" solution on droidnova, which involves setting a background color for the TableLayout, then setting a different background color for the TableRow and adding layout_margin to the row. I'm not fond of this solution, but it does work for row borders. I guess you could do the same thing with the items composing each "cell" item but I haven't verified.
An example similar to the one on DroidNova:
<TableLayout android:background="#000000"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow android:background="#FFFFFF"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="1dp">
...
</TableRow>
</TableLayout>
The original post is at http://www.droidnova.com/display-borders-in-tablelayout,112.html