public static void adaptTable(ConstraintTableLayout table){
  int width=table.getWidth();
  int height=table.getHeight();
  ConstraintWidget.DimensionBehaviour horizontalBehaviour=table.getHorizontalDimensionBehaviour();
  ConstraintWidget.DimensionBehaviour verticalBehaviour=table.getVerticalDimensionBehaviour();
  table.setHorizontalDimensionBehaviour(ConstraintWidget.DimensionBehaviour.WRAP_CONTENT);
  table.setVerticalDimensionBehaviour(ConstraintWidget.DimensionBehaviour.WRAP_CONTENT);
  table.layout();
  table.layout();
  table.setMinWidth(table.getWidth());
  table.setMinHeight(table.getHeight());
  table.computeGuidelinesPercentPositions();
  table.setHorizontalDimensionBehaviour(horizontalBehaviour);
  table.setVerticalDimensionBehaviour(verticalBehaviour);
  table.setWidth(width < table.getMinWidth() ? table.getMinWidth() : width);
  table.setHeight(height < table.getMinHeight() ? table.getMinHeight() : height);
  table.layout();
}

public static void adaptTable ( ConstraintTableLayout table ) { int width = table . getWidth ( ) ; int height = table . getHeight ( ) ; ConstraintWidget . DimensionBehaviour horizontalBehaviour = table . getHorizontalDimensionBehaviour ( ) ; ConstraintWidget . DimensionBehaviour verticalBehaviour = table . getVerticalDimensionBehaviour ( ) ; table . setHorizontalDimensionBehaviour ( ConstraintWidget . DimensionBehaviour . WRAP_CONTENT ) ; table . setVerticalDimensionBehaviour ( ConstraintWidget . DimensionBehaviour . WRAP_CONTENT ) ; table . layout ( ) ; table . layout ( ) ; table . setMinWidth ( table . getWidth ( ) ) ; table . setMinHeight ( table . getHeight ( ) ) ; table . computeGuidelinesPercentPositions ( ) ; table . setHorizontalDimensionBehaviour ( horizontalBehaviour ) ; table . setVerticalDimensionBehaviour ( verticalBehaviour ) ; table . setWidth ( width < table . getMinWidth ( ) ? table . getMinWidth ( ) : width ) ; table . setHeight ( height < table . getMinHeight ( ) ? table . getMinHeight ( ) : height ) ; table . layout ( ) ; }
adapt the table ' s dimensions and columns or rows to its content
