Commit 2654d928 authored by Jenny's avatar Jenny

feat: table width

parent be068e02
...@@ -71,8 +71,10 @@ ...@@ -71,8 +71,10 @@
const { frameStyle, frameWidth, frameColor, bordered } = this.elementInfo.table const { frameStyle, frameWidth, frameColor, bordered } = this.elementInfo.table
const { evenColor, oddColor, backgroundColor: cellBackgroundColor, titlePostion: cellTitlePostion, titleFontSize: cellTitleFontSize, cellRowHeight, titleColor: cellTitleColor} = this.elementInfo.table.tableCell const { evenColor, oddColor, backgroundColor: cellBackgroundColor, titlePostion: cellTitlePostion, titleFontSize: cellTitleFontSize, cellRowHeight, titleColor: cellTitleColor} = this.elementInfo.table.tableCell
const { headerRowHeight, titleColor: headerTitleColor, backgroundColor: headerBackgroundColor, titlePostion: headerTitlePostion, titleFontSize: headerTitleFontSize } = this.elementInfo.table.tableHeader const { headerRowHeight, titleColor: headerTitleColor, backgroundColor: headerBackgroundColor, titlePostion: headerTitlePostion, titleFontSize: headerTitleFontSize } = this.elementInfo.table.tableHeader
const cellWidth = this.elementInfo.table.column.length > 10 ? 130 : 240
return { return {
'--table-width': `${130 * this.elementInfo.table.column.length}rpx`, '--table-width': `${cellWidth * this.elementInfo.table.column.length}rpx`,
'--cell-width': `0 0 ${cellWidth}rpx`,
'--cell--background-color': cellBackgroundColor, '--cell--background-color': cellBackgroundColor,
'--even-color': evenColor, '--even-color': evenColor,
'--odd-color': oddColor, '--odd-color': oddColor,
...@@ -194,19 +196,15 @@ ...@@ -194,19 +196,15 @@
flex-direction: row; flex-direction: row;
} }
.th { .th {
flex: 0 0 130rpx; flex: var(--cell-width);
font-size: 28rpx; font-size: 28rpx;
color: $u-main-color; color: $u-main-color;
padding: 10px 0px; padding: 10px 0px;
background-color: rgb(245, 246, 248); background-color: rgb(245, 246, 248);
} }
.th-large {
flex: 0 0 220rpx;
font-weight: bold;
}
.td{ .td{
flex: 0 0 130rpx; flex: var(--cell-width);
align-self: stretch; align-self: stretch;
padding: 10px 0px ; padding: 10px 0px ;
font-size: 28rpx; font-size: 28rpx;
...@@ -216,10 +214,6 @@ ...@@ -216,10 +214,6 @@
justify-content: center; justify-content: center;
} }
.td-large{
flex: 0 0 220rpx;
}
.th_style { .th_style {
line-height: var(--header-row-height); line-height: var(--header-row-height);
font-size: var(--header-font-size); font-size: var(--header-font-size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment