Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML表格到Android表格布局_Android_Html_Tablelayout_Android Tablelayout - Fatal编程技术网

HTML表格到Android表格布局

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

我有从服务器获取的XML,我有如下HTML表:

<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..