收藏
回答

小程序 rich-text 无法渲染 table?

// 节点Json数据如下:

[ {
    "name" : "table",
    "attrs" : {
      "width" : "812"
    },
    "children" : [ {
      "name" : "tbody",
      "children" : [ {
        "name" : "tr",
        "attrs" : {
          "height" : "43",
          "class" : "firstRow"
        },
        "children" : [ {
          "name" : "td",
          "attrs" : {
            "width" : "41",
            "height" : "43"
          },
          "children" : [ {
            "name" : "p",
            "attrs" : {
              "class" : "vsbcontent_start"
            },
            "children" : [ {
              "type" : "text",
              "text" : "序号"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "419"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "工 作 内 容"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "93"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "起止周数"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "83"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "时间"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "176"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "负 责 单 位"
            } ]
          } ]
        } ]
      }, {
        "name" : "tr",
        "attrs" : {
          "height" : "43"
        },
        "children" : [ {
          "name" : "td",
          "attrs" : {
            "width" : "41",
            "height" : "43"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "1"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "419"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "2019~2020学年第二学期第二轮选课"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "93"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "第18-19周"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "83",
            "rowspan" : 5
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "元月"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "176"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "教务科"
            } ]
          } ]
        } ]
      }, {
        "name" : "tr",
        "attrs" : {
          "height" : "43"
        },
        "children" : [ {
          "name" : "td",
          "attrs" : {
            "width" : "41",
            "height" : "43"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "2"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "419"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "期末考试"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "93"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "第18-19周"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "176"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "考试中心、各学院"
            } ]
          } ]
        } ]
      }, {
        "name" : "tr",
        "attrs" : {
          "height" : "43"
        },
        "children" : [ {
          "name" : "td",
          "attrs" : {
            "width" : "41",
            "height" : "43"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "3"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "419"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "教学督导工作总结"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "93"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "第19周"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "176"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "质量评估中心"
            } ]
          } ]
        } ]
      }, {
        "name" : "tr",
        "attrs" : {
          "height" : "43"
        },
        "children" : [ {
          "name" : "td",
          "attrs" : {
            "width" : "41",
            "height" : "43"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "4"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "419"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "学籍异动汇总发文"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "93"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "第20周"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "176"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "学籍管理科"
            } ]
          } ]
        } ]
      }, {
        "name" : "tr",
        "attrs" : {
          "height" : "43"
        },
        "children" : [ {
          "name" : "td",
          "attrs" : {
            "width" : "41",
            "height" : "43"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "5"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "419"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "年终教学工作总结"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "93"
          },
          "children" : [ {
            "name" : "p",
            "children" : [ {
              "type" : "text",
              "text" : "第21周"
            } ]
          } ]
        }, {
          "name" : "td",
          "attrs" : {
            "width" : "176"
          },
          "children" : [ {
            "name" : "p",
            "attrs" : {
              "class" : "vsbcontent_end"
            },
            "children" : [ {
              "type" : "text",
              "text" : "教务处、各学院"
            } ]
          } ]
        } ]
      } ]
    } ]
  } ]
最后一次编辑于  2021-11-28
回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    2021-11-29

    你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2021-11-29
    有用
    回复
  • 玉
    发表于移动端
    2021-11-29
    我已经找到了,Json数据中的 attrs下面的rowspan不能是数字类型,应该改成 String类型,官方文档也没说清楚 attrs节点 Key-Value都应该是字符串
    2021-11-29
    有用 1
    回复
登录 后发表内容