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
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?
2 Comments
John Saunders
Note that we have no idea why he wants to do this.
SLaks
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.