Hi Harald,
Try this.
var doc = app.activeDocument, _selection = app.selection[0]; if(_selection instanceof Table) { var _columns = _selection.columns; for(var i =0;i<_columns.length;i++) { var _cells = _columns[i].cells, max = []; for(var j=0;j<_cells.length;j++) { var width = [], _lines = _cells[j].lines; for(var k =0;k<_lines.length;k++) { width.push(_lines[k].endHorizontalOffset - _lines[k].horizontalOffset + (_cells[j].leftInset + _cells[j].rightInset)); } max.push(Math.max.apply(null,width)); } _columns[i].width = Math.max.apply(null,max) } } else { alert("Select a table") }
Regards,
Chinna