I have a JavaFX 2 table that is displaying contact details for people, lets imagine there are three columns: first name, last name and email address. When my application sta
To generelize the width and use any number and make sure that the width is 100% of the table's width, you can use :
double[] widths = {20, 30, 50, 20, 30, 70, 50};//define the width of the columns
//calculate the sum of the width
double sum = 0;
for (double i : widths) {
    sum += i;
}
//set the width to the columns
for (int i = 0; i < widths.length; i++) {
    table.getColumns().get(i).prefWidthProperty().bind(
            table.widthProperty().multiply(sizes[i] / sum));
    //---------The exact width-------------^-------------^
}