您当前的位置: 首页 > 知识百科 > 微信小程序制作表格代码和步骤

微信小程序制作表格代码和步骤

时间:2023-07-01 14:05 阅读数:165 人阅读 分类:知识百科

  开发小程序在年轻人群体中比较流行,因为新奇又有用,能够开发出不少微信隐藏的小程序功能。现在小编想为大家介绍一下微信小程序制作表格怎么弄。

  由于需要开发小程序,前端又是自己弄,类似table的标签也没有,后来看到小程序文档中推荐使用flex布局,就把css中的flex布局学了一遍,效果还行,大家将就看一下

  table.wxml

  head1

  head2

  head3

  {{item.code}}

  {{item.text}}

  {{item.type}}

  {{item.code}}

  {{item.text}}

  {{item.type}}

  1234567891011121314151617181912345678910111213141516171819

  table.wxss

  .table {

  border: 0px solid darkgray;

  }

  .tr {

  display: flex;

  width: 100%;

  justify-content: center;

  height: 3rem;

  align-items: center;

  }

  .td {

  width:40%;

  justify-content: center;

  text-align: center;

  }

  .bg-w{

  background: snow;

  }

  .bg-g{

  background: #E6F3F9;

  }

  .th {

  width: 40%;

  justify-content: center;

  background: #3366FF;

  color: #fff;

  display: flex;

  height: 3rem;

  align-items: center;

  }123456789101112131415161718192021222324252627282930123456789101112131415161718192021222324252627282930

  table.js

  Page({

  data: {

  listData:[

  {"code":"01","text":"text1","type":"type1"},

  {"code":"02","text":"text2","type":"type2"},

  {"code":"03","text":"text3","type":"type3"},

  {"code":"04","text":"text4","type":"type4"},

  {"code":"05","text":"text5","type":"type5"},

  {"code":"06","text":"text6","type":"type6"},

  {"code":"07","text":"text7","type":"type7"}

  ]

  },

  onLoad: function () {

  console.log('onLoad')

  }

  })12345678910111213141516171234567891011121314151617

  效果图如下

  


  现在你知道微信小程序制作表格怎么弄了啊?虽然这是很简单的表格,但是也要留意每一个代码和每一个操作步骤才行,想要获取更多相关资料请关注微信小程序素材网。

  

  微信小程序动态表格怎么开发

  微信小程序表格布局怎么弄

  在微信小程序中怎么弄动态处理表格?