HTML表格到Android表格布局
我有从服务器获取的XML,我有如下HTML表:HTML表格到Android表格布局,android,html,tablelayout,android-tablelayout,Android,Html,Tablelayout,Android Tablelayout,我有从服务器获取的XML,我有如下HTML表: <table> <tr> <td colspan="4">$kolumn1$</td> </tr> <tr> <td colspan="2">$kolumn2$</td> <td>$kolumn3$</td> <td>$kolumn
<table>
<tr>
<td colspan="4">$kolumn1$</td>
</tr>
<tr>
<td colspan="2">$kolumn2$</td>
<td>$kolumn3$</td>
<td>$kolumn4$</td>
</tr>
<tr>
<td>$kolumn5$</td>
<td colspan="3">$kolumn1$</td>
</tr>
</table>
<TableRow
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_span="4" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_span="2" />
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_span="3" />
</TableRow>
$kolumn1$
$kolumn2$
$kolumn3$
$kolumn4$
$kolumn5$
$kolumn1$
现在,我想创建如下Android TableLayout:
<table>
<tr>
<td colspan="4">$kolumn1$</td>
</tr>
<tr>
<td colspan="2">$kolumn2$</td>
<td>$kolumn3$</td>
<td>$kolumn4$</td>
</tr>
<tr>
<td>$kolumn5$</td>
<td colspan="3">$kolumn1$</td>
</tr>
</table>
<TableRow
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_span="4" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_span="2" />
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent" />
<TextView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_span="3" />
</TableRow>
从HTML代码创建TableLayout的最佳方法是什么?试试以下方法:
I have to like create Relative layout inside the TableRow
And put the components to Relative layout
It's worked me. I hope this will be worked for you also..