美文网首页小程序
微信小程序怎么做出前端table的效果

微信小程序怎么做出前端table的效果

作者: 罗小耳 | 来源:发表于2018-01-22 17:04 被阅读50次
    111.png

    wxml代码:

    <view class="container">
    <view class="table">
    <view class="tr">
    <view class="th">标题1</view>
    <view class="th">标题2</view>
    <view class="th">标题3</view>
    <view class="th">标题4</view>
    <view class="th">标题5</view>
    </view>
    <view class="tr" wx:for="{{5}}">
    <view class="td">{{内容}}</view>
    <view class="td">{{内容}}</view>
    <view class="td">{{内容}}</view>
    <view class="td">{{内容}}</view>
    <view class="td">{{内容}}</view>
    </view>
    </view>
    </view>

    wxss代码:
    /* pages/table/table.wxss */
    page {
      font-size: 14px;
      color: #333
    }
    .table {
      border:1px solid #dadada;
      border-right: 0;
      border-bottom: 0;
      width: 98%;
    }
    .tr {
      width: 100%;
      display: flex;
      justify-content: space-between;
    }
    .th,.td {
      padding: 10px;
      border-bottom: 1px solid #dadada;
      border-right: 1px solid #dadada;
      text-align: center;
      width:100%
    }
    .th {
      font-weight: 400;
      background-color: #dadada
    }

    相关文章

      网友评论

        本文标题:微信小程序怎么做出前端table的效果

        本文链接:https://www.haomeiwen.com/subject/lgzlaxtx.html