title: I am trying to change the properties of a table cell with javascript and have found my suggestions but I can't seem to get them to work
body: <p>I have a table where each row has 7 input columns.  I want to disable the 3rd column of each row and change the text color to red.<br>
  </p>
  
  <pre><code>function changeCells() {
    var table = document.getElementById("tbl");
    for (var i = 0; i &lt; table.rows.length; i++) {
      var tr = table.getElementsByTagName("tr")[i];
      var td = tr.getElementsByTagName("td")[2];
      td.style.color = 'red';
      td.disabled = true;
    }
  }
  </code></pre>
  
  <p>I can change the background with:</p>
  
  <p><code>td.style.backgroundColor = 'red';</code></p>
  
  <p>but not the text color.</p>
  
  <p>The input column is also not disabled. Not sure why this code doesn't work. </p>