Question

I have a table that contains input cells for quantities. I cannot change the default size of TextInputCellCustom even if I already set the column width.

Is there a way to resize the TextInputCellCustom? Maybe through css but I can't figure out how.

my code is something like this:

private Column<PpmpItem, String> getQ1QuantityColumn() {
   if (q1QuantityColumn == null) {
      final TextInputCellCustom inputCell = new TextInputCellCustom();
      q1QuantityColumn = new Column<PpmpItem, String>(inputCell) {
         @Override
         public String getValue(PpmpItem object) {
            return Integer.toString(object.getQ1Qty());
         }
      };
      FieldUpdater<PpmpItem, String> fieldUpdater = new QuantityFieldUpdater(1);
      q1QuantityColumn.setFieldUpdater(fieldUpdater);
   }
   return q1QuantityColumn;
}
Was it helpful?

Solution

Add this style to your table:

.myTable td input {
    width:  100%;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top