Skip to content

Commit 3eee08f

Browse files
committed
feat: [REQUEST] Adjustable Column Widths for QTables quasarframework#2248
1 parent e2474f8 commit 3eee08f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

dev/components/components/data-table.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ export default {
474474
sortable: true
475475
},
476476
{ name: 'calories', align: 'center', label: 'Calories', field: 'calories', sortable: true },
477-
{ name: 'fat', label: 'Fat (g)', field: 'fat', sortable: true },
477+
{ name: 'fat', label: 'Fat (g)', field: 'fat', sortable: true, classes: 'bg-grey', style: 'width: 10px' },
478478
{ name: 'carbs', label: 'Carbs (g)', field: 'carbs' },
479479
{ name: 'protein', label: 'Protein (g)', field: 'protein' },
480480
{ name: 'sodium', label: 'Sodium (mg)', field: 'sodium' },

src/components/table/table-body.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export default {
3737
const slot = this.$scopedSlots[`body-cell-${col.name}`]
3838
return slot
3939
? slot(this.addBodyCellMetaData({ row, col: col }))
40-
: h('td', { staticClass: col.__tdClass }, this.getCellValue(col, row))
40+
: h('td', {
41+
staticClass: col.__tdClass,
42+
style: col.style,
43+
'class': col.classes
44+
}, this.getCellValue(col, row))
4145
})
4246

4347
if (this.hasSelectionMode) {

src/components/table/table-header.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export default {
4747
sort: this.sort,
4848
colsMap: this.computedColsMap
4949
}
50-
}
50+
},
51+
style: col.style,
52+
'class': col.classes
5153
}, col.label)
5254
}
5355
const child = this.computedCols.map(mapFn)

0 commit comments

Comments
 (0)