I have an ASP.NET page and I am generating an HTML table in my server side code (codebehind file )as follows.
HtmlTable iTblCart = new HtmlTable();
HtmlTableRow iRowHeader = new HtmlTableRow();
HtmlTableCell iCellHead1 = new HtmlTableCell();
iCellHead1.InnerText= "Item";
iRowHeader.Cells.Add(iCellHead1);
iTblCart.Rows.Add(iCartRow);
pnlPhoneCart.Controls.Add(iTblCart); //appending to a panel
I want to apply a CSS class to this table.I could not find such a property from the intellisense.Am i missing anything ? Can anyone guide me how to go ahead ?
Yes I got the answer.Here it is
iTblCart.Attributes.Add("Class", "clsTradeInCart");
and clsTradeInCart is my CSS class name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With