Style classes set on table columns are ignored

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 7u15
    • Component/s: javafx
    • None
    • Environment:

      Windows 7, JavaFX 2.2.7, Java7u17

      I can right align text in all columns in a TableView using the following css:

      .right-aligned .table-cell {
        -fx-alignment: center-right;
      }

      And in code setting:

      table.getStyleClass().add("right-aligned");

      But, if I want to instead just right align the text in a single column using the same css and the following code:

      emailCol.getStyleClass().add("right-aligned");

      The emailCol is not right aligned.

      For test purposes I am using Example 13.6 from the TableView control tutorial:
      http://docs.oracle.com/javafx/2/ui_controls/table-view.htm#CJABHGAJ

      Related StackOverflow question:
      http://stackoverflow.com/questions/13455326/javafx-tableview-text-alignmen

            Assignee:
            Jonathan Giles
            Reporter:
            John Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: