wxml
<view class="table"> <view class="tr bg-w"> <view class="th">张三</view> <view class="th" style="color: #409eff;">李四</view> <view class="th ">王五</view> <view class="th ">赵六</view> </view> <block> <view class="tr bg-g"> <view class="td">男</view> <view class="td" style="color:#409eff">男</view> <view class="td">女</view> <view class="td">男</view> </view> </block> </view>
wxss:想加其他样式得可以自己+
.tr { display: flex; width: 100%; justify-content: center; height: 3rem; align-items: center; } .td { width: 40%; justify-content: center; text-align: center; } .th { width: 40%; justify-content: center; /* color: #fff; */ display: flex; height: 3rem; align-items: center; font-size: 15px; }
总结:有循环的可以自己填写数据