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

Style classes set on table columns are ignored

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 7u15
    • 8
    • javafx
    • None
    • Windows 7, JavaFX 2.2.7, Java7u17

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported: