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
views:
147answers:
3
+1
A:
System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table();
ck
2009-07-07 10:25:00
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
2009-07-07 10:42:28
Note that we have no idea why he wants to do this.
John Saunders
2009-07-07 14:10:59
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
2009-07-07 14:38:13