0
<table style="width: 560px; border: 2px solid #fee3cc; font-size: 1em;" rules="all" border="1" cellpadding="5" cellspacing="0">    
<tbody>   
<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

4
  • What do you mean by directly show table like above? Are you showing this table inside webview? Commented May 26, 2011 at 8:08
  • yes i want to showing inside the webview Commented May 26, 2011 at 8:12
  • 4
    Ok now could you please rephrase your question? Commented May 26, 2011 at 8:14
  • how i add above code in web view Commented May 26, 2011 at 8:47

1 Answer 1

2

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");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.