How to change ng2 smart table column width?

Chanaka Amarasinghe picture Chanaka Amarasinghe · Jul 18, 2018 · Viewed 10.8k times · Source

This is a sample of my three columns. I want to customize the width sizes.

resetPassword: {
    title: this.gridTittle["ResetPassword"],
    type: 'custom',
    renderComponent: UserPasswordResetComponent,
    filter: false
},
userName: {
    title: this.gridTittle["UserName"],
},
roleTypeDescription: {
    title: this.gridTittle["UserType"],
    type: 'text',
    filter: false
},

Answer

Caio Ladislau picture Caio Ladislau · Aug 14, 2018

You can use the width property. As the documentation, "column width example: '20px', '20%'". In your code:

resetPassword: {
    title: this.gridTittle["ResetPassword"],
    type: 'custom',
    renderComponent: UserPasswordResetComponent,
    filter: false,
    width: 25%
},
userName: {
    title: this.gridTittle["UserName"],
    width: 25%
},
roleTypeDescription: {
    title: this.gridTittle["UserType"],
    type: 'text',
    filter: false,
    width: 50%
},