Create Table from HTML code
<table style="width: 560px; border: 2px solid #fee3cc; font-size: 1em;" rules="all" border="1" cellpadding="5" cellspacing="0">
<tbody&开发者_C百科gt;
<tr>
<td>
<p>Bharatiya Jana Sangh</p>
</td>
<td>
<p>1951 - 1977</p>
</td>
</tr>
<tr>
<td>
<p>Janata Party</p>
</td>
<td>
<p>1977 - 1979</p>
</td>
</tr>
<tr>
<td>
<p>Bharatiya Janata Party</p>
</td>
<td>
<p>1980</p>
</td>
</tr>
</tbody>
</table>
I have the html code of table as above, and I want to directly show a new table on layout as above table code, how I can do this
In your activity:
WebView webview = new WebView(this);
setContentView(webview);
String yourHtml = "<html><body><table>...</table></body></html>";
webview.loadData(yourHtml , "text/html", "utf-8");
精彩评论