I am creating Table dynamically:
Table table = new Table();
table.CssClass="tableclass";
...
pnlPanel.Controls.Add(table);
As I result I am getting html code:
<table border="0" ...>
I do not want to have border attribute at all. I do not want to style table in my code, I want to use CssClass instead.
I have tried to use both of these:
tblCalendar.GridLines = GridLines.None;
tblCalendar.Attributes.Remove("border");
with no success – I am stil getting border attribute.
I would use the HtmlTable class instead. It’s less intrusive if you’re primarily going to interact with the table on the client side.
http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmltable.aspx