title: CSS applied only to odd rows
body: <p>I have a table view populated with Samples objects. I want to fill the TableRow if a property of the Samples object = true. I used a method based on this answer of jewelsea: <a href="https://stackoverflow.com/questions/10925882/disable-tablerow-based-on-data">Disable TableRow based on data</a></p>
  
  <pre><code>int i = 0;
  if (tblSamples.getItems().size() &gt; 0) {
      for (Node n : tblSamples.lookupAll("TableRow")) {
          if (n instanceof TableRow) {
              TableRow row = (TableRow) n;
              row.getStyleClass().removeAll("hasMastitisRow");
  
              if (tblSamples.getItems().get(i).getClinicalMastitis()) {
                  row.getStyleClass().add("hasMastitisRow");
              }
              i++;
  
              if (i == tblSamples.getItems().size()) {
                  break;
              }
          }
      }
  }
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.hasMastitisRow {  
      -fx-control-inner-background: linear-gradient(#FFFFFF 85%, red 100%);
  }
  </code></pre>
  
  <p>However, it only applies on odd rows, on even rows it does not seem to work? </p>
  
  <p>Edit: it also seems I get following errors when the CSS is applied to even rows (on odd rows I get no errors):</p>
  
  <pre><code>WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-table-cell-border-color' while resolving lookups for '-fx-background-color' from rule '*.table-row-cell:odd' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-control-inner-background' while resolving lookups for '-fx-text-fill' from rule '*.table-cell' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-control-inner-background' while resolving lookups for '-fx-text-fill' from rule '*.table-cell' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-control-inner-background' while resolving lookups for '-fx-text-fill' from rule '*.table-cell' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-control-inner-background' while resolving lookups for '-fx-text-fill' from rule '*.table-row-cell' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-table-cell-border-color' while resolving lookups for '-fx-background-color' from rule '*.table-row-cell:odd' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-control-inner-background' while resolving lookups for '-fx-text-fill' from rule '*.table-cell' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-control-inner-background' while resolving lookups for '-fx-text-fill' from rule '*.table-cell' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  WARNING: com.sun.javafx.css.StyleHelper calculateValue Could not resolve '-fx-control-inner-background' while resolving lookups for '-fx-text-fill' from rule '*.table-cell' in stylesheet jar:file:/C:/Program%20Files/Java/jdk1.7.0_15/jre/lib/jfxrt.jar!/com/sun/javafx/scene/control/skin/caspian/caspian.bss
  </code></pre>
  
  <p><strong>edit:</strong>
  New approach but still the same result (applied on odd rows, not on even rows):</p>
  
  <pre><code>tc_Samples_Quarter.setCellFactory(new Callback&lt;TableColumn&lt;Samples, String&gt;, TableCell&lt;Samples, String&gt;&gt;() {
          @Override
          public TableCell&lt;Samples, String&gt; call(TableColumn&lt;Samples, String&gt; soCalledSampleRowStringTableColumn) {
              return new TableCell&lt;Samples, String&gt;() {
                  @Override
                  public void updateItem(final String item, final boolean empty) {
                      super.updateItem(item, empty);
                      this.getTableRow().getStyleClass().remove("hasMastitisRow");
                      if (item != null) {
                          setText(item);
                          this.getTableRow().getStyleClass().add("hasMastitisRow");
                      } else {
                          setText(null);
                      }
                  }
              };
          }
      });
  </code></pre>