1

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

3 Answers 3

2

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?

Sign up to request clarification or add additional context in comments.

2 Comments

Note that we have no idea why he wants to do this.
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.
1
System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table();

Comments

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

Comments

Your Answer

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