开发者

Create Table from HTML code

开发者 https://www.devze.com 2023-03-08 06:46 出处:网络
<table style=\"width: 560px; border: 2px solid #fee3cc; font-size: 1em;\" rules=\"all\" border=\"1\" cellpadding=\"5\" cellspacing=\"0\">
<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");
0

精彩评论

暂无评论...
验证码 换一张
取 消