Primeng Turbo Table autoLayout在简单的p表上不起作用

时间:2019-01-11 22:39:02

标签: angular primeng

我有这个简单的primeng 7.0 turbo表,p表。它是不可调整大小和不可滚动的。我似乎并没有影响该表的布局。 autoLayout应该首先按照文档工作。有人可以评论这可能是什么问题吗?

VARCHAR(10) 

我的组件文件:

<p-table #availableTable [value]="sourceCars" selectionMode="multiple" 
[(selection)]="selectedItemsSource" [autoLayout]="true">
        <ng-template pTemplate="header">
            <tr>
                <th>Name</th>
                <th>Type</th>
            </tr>            
        </ng-template>
        <ng-template pTemplate="body" let-car>
            <tr [pSelectableRow]="car">
                <td>{{car.label}}</td>
                <td>{{car.value}}</td>
            </tr>
        </ng-template>
    </p-table>

My table image

My table with same code ..

1 个答案:

答案 0 :(得分:0)

正如primeNG documentation关于属性 <input type="submit" name="s" value="ds"/> 所说:

autoLayout

这意味着该列应调整大小以避免内容太大时溢出。

我对属性Whether the cell widths scale according to their content or not.scrollable进行了一些测试,并得到了您所需的滚动行为。

我将代码放到stackblitz中以简化测试: https://stackblitz.com/edit/angular-arzgvr

相关问题