×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to change the properties of a table cell?

How to change the properties of a table cell?

How to change the properties of a table cell?

(OP)
I have a table in HTML inside my page that has all the cells set to a color of gray background and I want to be able to change this color at runtime.  I have checked the Programmable button and named the cells.  This is a sample of my code that I am trying to execute. tbl_cell_1.setProperty("BGCOLOR", "BLUE");
This does nothing to the cell it still displays as gray when the page is called.  Any help is appreciated.

Alex

RE: How to change the properties of a table cell?

If you want to do it in Java, you need to include it in the rowGenerateBegin. See also page 240 in the programmer's guide from version 3.7 december 2000, row-level formatting.

Another way is to use javascript. In short...

var myLayer;
myLayer = document.all[id];
myLayer.style.backgroundColor = '#d2d1dc';
myLayer.style.color='black';

[id ] is the name of the cell.
This javascript is for Internet Explorer 5.0+ It don't work with IE4 or NS < 6.1.

The advantage of javascript here is, you don't need a page-submit to alter the colors.

Hope this helps,

Greetings

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close