Results 1 to 2 of 2

Thread: Table cell not taking CSS effect

  1. #1
    Join Date
    Oct 2009
    Posts
    11

    Table cell not taking CSS effect

    Hi,

    I am trying out an experiment here:

    Code:
    <html>
    <head>
    <style>
        #tableContent td.cellClass 
        {
            background  : red;
            font-size   : smaller;
            font-weight : bold;
        }
    </style>
    </head>
    <body>
        <div id="tableContainer"><table id="tableContent"></table></div>
        
        <script type="text/javascript">
            var row, cell;
            var tableContainer;
            var tableContent;
            
            tableContainer = document.getElementById('tableContainer');
            tableContent   = document.getElementById('tableContent');
            
            row            = tableContent.insertRow(0);
            cell           = row.insertCell(0);
            cell.innerHTML = "Test Cell";
            cell.class     = "cellClass";
        </script>    
    </body>
    </html>
    The table cell don't seems to take effect of the CSS style.
    Any idea guys?

  2. #2
    Join Date
    Oct 2009
    Posts
    11
    duh, cell.className.

Similar Threads

  1. Table Cell Background?
    By spatel783 in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 08 Sep 2007, 04:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •