473,395 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

HtmlTable control css class

Can anyone show me how to set the css class of an HtmlTable control in
code on the server?

I can't find any indication that the css class is a property of the
HtmlTable, HtmlTableRow and HtmlTableCell classes. I'm getting the
uncomfortable feeling that this can't be done, even though it seems
incredible to me!

Nov 18 '05 #1
2 6271
Alfred,
Any time you want to add any attribute that may not be included in the
code, just use HtmlTable.Attributes["class"] = "myCSSClass";
This will work for any attribute.

Best regards,
Jeffrey Palermo

"Alfred Salton" <al***********@hotmail.com> wrote in message
news:2004062721504216807%alfredsalton@hotmailcom.. .
Can anyone show me how to set the css class of an HtmlTable control in
code on the server?

I can't find any indication that the css class is a property of the
HtmlTable, HtmlTableRow and HtmlTableCell classes. I'm getting the
uncomfortable feeling that this can't be done, even though it seems
incredible to me!

Nov 18 '05 #2
Thanks Jeffrey, this works just fine. It is perhaps worth noting that
Attributes["class"] = "myCSSClass" uses C# syntax. VB is
Attributes("class") = "myCSSClass". This trips me up regularly - I much
prefer C# syntax, but am sometimes forced to use VB.
Alfred,
Any time you want to add any attribute that may not be included in the
code, just use HtmlTable.Attributes["class"] = "myCSSClass";
This will work for any attribute.

Best regards,
Jeffrey Palermo

"Alfred Salton" <al***********@hotmail.com> wrote in message
news:2004062721504216807%alfredsalton@hotmailcom.. .
Can anyone show me how to set the css class of an HtmlTable control in
code on the server?

I can't find any indication that the css class is a property of the
HtmlTable, HtmlTableRow and HtmlTableCell classes. I'm getting the
uncomfortable feeling that this can't be done, even though it seems
incredible to me!

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ajay Desh | last post by:
Hi I am gettin error, if i try to find the top position of a table. Here is what i am doing.I have a HtmlTable (Table3 is the name/id) created.It has a position and a Top and Left co-ordinates...
2
by: Michael Meckelein | last post by:
Hi all! I have a table like Table myTable = new Table(); Now, I want to publish the table as part of a webpage and as part of a word document. I tried to convert the table, but the compiler...
2
by: suzy | last post by:
what is the difference between a htmltable control and a table control i know one is server control and the other is not, but when would each be used? also, how do you set the class of a html...
2
by: Raed Sawalha | last post by:
Hi, This is probably pretty simple but... I am dynamically adding rows to a HtmlTable that contain Textbox controls. (There may be more than one server control/textbox in a given cell) How...
1
by: Leo | last post by:
I created a user control which is some text contained in a HtmlTable. I put this control into main form. I would like to have the ability to move this control around in the main form. I think one...
1
by: TRobran | last post by:
What I'm trying to do seems pretty straightforward so I must be missing something simple. Any help is greatly appreciated. On my page I have a DropDownList, a HtmlTable and a Button. Each row...
3
by: gh | last post by:
I have a HTML Table with 1 row and 1 column. I have a control I want to add to the cell at runtime based on a condition. I can get the control added by creating a row and cell and using the code...
1
by: motorhead_maniac | last post by:
Hello, Iam trying to apply a css class while creating a html table in a server control. Iam using the HtmlTable class to generate table, the HtmlTable class has a Style property which takes...
0
by: purnimakarnati | last post by:
Hi All, Can anybody solve my problem. I created a HTMLTable with a dataset by a method called addTable(dataset) After creating a new table and new row I am adding cells and in each cell I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.