微信小程序实现的绘制table表格功能示例

Page({ data:{ infeed:['"", "1周", "2周", "3周", "总计"], endwise1: "游泳", tb1:"0", tb2:"0", tb3:"0", tb4:"0", endwise2: "跑步", tc1:"0", tc2:"0", tc3:"0", tc4:"0", endwise3: "健身", td1:"0", td2:"0", td3:"0", td4:"0", } })

wxml

<view> <view> <block wx:for="{{infeed}}" wx:key="*this"> <view>{{item}}</view> </block> </view> <block > <view > <view>{{endwise1}}</view> <view>{{tb1}}</view> <view>{{tb2}}</view> <view>{{tb3}}</view> <view>{{tb4}}</view> </view> <view > <view>{{endwise2}}</view> <view>{{tc1}}</view> <view>{{tc2}}</view> <view>{{tc3}}</view> <view>{{tc4}}</view> </view> <view > <view>{{endwise3}}</view> <view>{{td1}}</view> <view>{{td2}}</view> <view>{{td3}}</view> <view>{{td4}}</view> </view> </block> </view>

wxss

.tle { border-top: 1px solid #ebc450; margin: 20rpx 0; border-left: 1px solid #c9c9c9; } .ae { display: flex; width: 100%; justify-content: center; align-items: center; text-align: center; } .wc { width: 40%; justify-content: center; text-align: center; height: 90rpx; line-height: 90rpx; border-bottom: 1px solid #c9c9c9; border-right: 1px solid #c9c9c9; } .by-c{ background: snow; } .by-w { background: #e6f3f9; } .a-y { background: #ffecb5; border-bottom: 1px solid #edd079; border-right: 1px solid #edd079; } .dd { width: 40%; border-bottom: 1px solid #edd079; border-right: 1px solid #edd079; justify-content: center; background: #ffecb5; color: #333; display: flex; height: 90rpx; align-items: center; }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/6aa1bd79c9abf5ce3a4fa91e5c8abc2e.html