title: Increase the cell size of a particular Row -JAVAFX TableView
body: <p>I am trying to resize a particular <code>cell</code> in <code>TableView</code> in a particular <code>Row</code>.</p>
  
  <p>The code i use,</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.application.Platform;
  import javafx.beans.property.SimpleStringProperty;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.geometry.Pos;
  import javafx.scene.Scene;
  import javafx.scene.control.TableCell;
  import javafx.scene.control.TableColumn;
  import javafx.scene.control.TableView;
  import javafx.stage.Stage;
  import javafx.util.Callback;
  
  public class TableColors extends Application {
  
      TableView&lt;String&gt; tView = new TableView&lt;&gt;();
  
      @Override
      public void start(Stage primaryStage) {
          TableColumn&lt;String, String&gt; tcName = new TableColumn("name");
          TableColumn&lt;String, String&gt; tcName1 = new TableColumn("name1");
          ObservableList&lt;String&gt; items = FXCollections.observableArrayList("One", "Two", "Three", "Four");
          tView.setItems(items);
          tView.getColumns().add(tcName);
          tView.getColumns().add(tcName1);
  
          tView.setColumnResizePolicy((param) -&gt; true);
          Platform.runLater(() -&gt; customResize());
  
          tcName.setCellValueFactory((p) -&gt; new SimpleStringProperty(p.getValue()));
          tcName.setCellFactory(new Callback&lt;TableColumn&lt;String, String&gt;, TableCell&lt;String, String&gt;&gt;() {
              @Override
              public TableCell call(TableColumn p) {
                  return new TableCell&lt;String, String&gt;() {
                      @Override
                      public void updateItem(final String item, final boolean empty) {
                          super.updateItem(item, empty);//*don't forget!
                          if (item != null) {
                              setText(item);
                              setAlignment(Pos.CENTER);
                          } else {
                              setText(null);
                          }
                      }
                  };
              }
          });
  
          Scene scene = new Scene(tView, 300, 250);
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      private void customResize() {
          try {
              TableColumn&lt;?, ?&gt; col = tView.getColumns().get(0);
              col.setPrefWidth(150);
          } catch (Exception r) {
              r.printStackTrace();
          }
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>when i run this complete <code>name</code> <strong>column</strong> size is increased(as expected).</p>
  
  <p>Instead i want to increase only the size of the cell which contains "<strong>Three</strong>". </p>
  
  <p>Am not sure ,What code should i incorporate to make it work in this way.</p>
  
  <p>How can i solve this?</p>