tags:

views:

147

answers:

3

Hi I would like to get all the properties used in System.Web.UI.WebControls.Table which is simple but the catch is that it needs to be done in a windows form application. My actual question is how can I create an instance of System.Web.UI.WebControls.Table in a form

A: 
var table = new System.Web.UI.WebControls.Table();
John Saunders
+1  A: 

System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table();

ck
A: 

You need to use the WebBrowser control to display HTML.

EDIT: To generate the HTML, try the following:

var table = new Table();
//Add rows and cells

var stringWriter = new StringWriter();
using (var htmlWriter = new HtmlTextWriter(stringWriter)) {
    table.RenderControl(htmlWriter);
}
//To get the generated html, use stringWriter.ToString()

EDIT: Have you considered using a TableLayoutPanel instead?

SLaks
Note that we have no idea why he wants to do this.
John Saunders
I know; that's why I suggested the TableLayoutPanel control. If he's trying to display other HTML in the table, it'll be useless.
SLaks