当前位置: 首页 > news >正文

微信小程序实现table表格

微信小程序没有table标签,运用display:table和display:flex实现一个内容字数不固定表格……

wxml:

<view class="ContentShow">
<view class="conht">烟台市新闻发布会登记审批表</view>
<view class="table">
<view class="tr">
<view class="td">新闻发布会名称</view>
<view class="td">{{ContentData.title}}</view>
</view>
<view class="tr">
<view class="td">发布单位</view>
<view class="td">{{ContentData.name}}</view>
</view>
<view class="tr">
<view class="td">发布人姓名、职务</view>
<view class="td">{{ContentData.publisher}}、{{ContentData.publisher_post}}</view>
</view>
<view class="tr">
<view class="td">主持人姓名、职务</view>
<view class="td">{{ContentData.host}}、{{ContentData.host_post}}</view>
</view>
<view class="tr">
<view class="td">媒体发布范围</view>
<view class="td">{{ContentData.nrangeame}}</view>
</view>
<view class="tr">
<view class="td">发布会举办时间</view>
<view class="td">{{ContentData.start_time}}至{{ContentData.end_time}}</view>
</view>
<view class="tr">
<view class="td">发布会举办地点</view>
<view class="td">{{ContentData.place}}</view>
</view>
<view class="tr">
<view class="td">是否报经分管市领导同意</view>
<view class="td">{{ContentData.place}}</view>
</view>
<view class="trOne">
<text>发布会主要内容</text>
<rich-text nodes="{{ContentData.content}}"></rich-text>
</view>
<view class="trTwo">
<view class="colus">
<text class="txtLine">主管部门意见</text>
<view class="coluCont"><text>(盖章)  年 月 日</text>
</view>
</view>
<view class="colus">
<text class="txtLine">市政府新闻办意见</text>
<view class="coluCont"><text>(盖章)  年 月 日</text>
</view>
</view>
</view>
<view class="tr">
<view class="td">主要负责任人、联系方式</view>
<view class="td">{{ContentData.chargeperson_main}}</view>
</view>
<view class="tr" style="display:{{returnReason}}">
<view class="td">驳回原因</view>
<view class="td">{{ContentData.reason}}</view>
</view>
</view>
</view>

wxss:

.table{border-left:1px solid #666;border-top:1px solid #666;font-size:.9rem;line-height:1.6rem;color:#666;margin:1.5rem 1.5rem 1rem 1.5rem;}
.tr{width:100%;display:table;}
.td{padding:0.2rem 0.5rem;text-align:center;box-sizing:border-box;display:table-cell;vertical-align:middle;}
.tr view:nth-child(1){width:30%;}
.tr view:nth-child(2){flex:1;width:70%;}.trOne{border-right:1px solid #666;box-sizing:border-box;padding:0.5rem;border-bottom:1px solid #666;}
.trOne text{display:block;text-align:center;padding-bottom:.5rem;}.trTwo{display:flex;justify-content:space-between;box-sizing:border-box;}
.colus{flex:1;}
.txtLine{display:block;text-align:center;border-bottom:1px solid #666;}
.coluCont{min-height:5rem;align-items:flex-end;display:flex;}
.coluCont text{display:block;text-align:right;width:100%;padding-right:0.5rem;box-sizing:border-box;}.td,.colus{border-bottom:1px solid #666;border-right:1px solid #666;}

http://www.lqws.cn/news/600211.html

相关文章:

  • vue+three.js 加载模型,并让模型随航线飞行
  • 服务器种类与超融合
  • CSS 安装使用教程
  • mysql的自增id用完怎么办?
  • 【MobaXterm、Vim】使用合集1
  • 多容器应用与编排——AI教你学Docker
  • 单端输入转差分输出
  • ELK日志分析系统(filebeat+logstash+elasticsearch+kibana)
  • 学习字符串
  • AKAZE(Accelerated-KAZE)图像特征点检测算法详解和C++代码实现示例
  • 初识QT-对象树
  • Adobe AI高效设计秘籍与创新思维进阶
  • STM32
  • 三极管是NPN还是PNP
  • 为什么Netty 性能高
  • 关于vue2使用elform的rules校验
  • 第8章路由协议,RIP、OSPF、BGP、IS-IS
  • Zephyr RTOS 信号量 (Semaphore)
  • SpringMVC--使用RESTFul实现用户管理系统
  • 鸿蒙学习——开发中遇到的问题记录
  • Windows VMWare Centos Docker部署Springboot + mybatis + MySql应用
  • Embeddings模型
  • IOday2--7.1
  • 工作中常用的Git操作命令(一)
  • 电脑键盘不能打字了怎么解决 查看恢复方法
  • Wisdom SSH 与宝塔面板:深度对比剖析
  • P1312 [NOIP 2011 提高组] Mayan 游戏
  • 将POD指定具体机器上运行
  • ip网络基础
  • 睿抗-2025年江西省第三题