Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8118031

Style classes set on table columns are ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u15
    • javafx
    • None
    • 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

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

              Created:
              Updated:
              Resolved:
              Imported: