jq读取json显示到标题及表格(并点击标题显示及隐藏表格)

这篇博客展示了如何使用jQuery将JSON数据加载到HTML页面,并动态创建表格以显示项目编码、项目名称、项目特征等信息。点击标题可以显示或隐藏对应的详细表格内容。
摘要由CSDN通过智能技术生成

效果图:

html:

<body>
         <div class="main">
              <table class="bt">
                  <tr>
                      <th style="width:86px;">序号</th>
                      <th style="width:318px;">项目编码</th>
                      <th style="width:27%;">项目名称</th>
                      <th style="width:27%;">项目特征</th>
                      <th style="width:128px;">工程量</th>
                      <th style="width:128px;">计量单位</th>
                      <th style="width:115px;">详情</th>
                  </tr>
              </table>
              <!-- 表格数据-->
             <div class="content">
                 <div class="qt">
                     <div class="title">
                         <span class="icon"></span>
                         <span class="tit"></span>
                     </div>
                      <table class="shu checkTab" id="">
                          <tbody>
                              <tr>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                  <td></td>
                              </tr>
                          </tbody>
                      </table>
                  </div>
             </div>
         </div>
        

    </body>


css:

body,.main{
    margin: 0;
    padding:0;
    width:100%;
    height:100%
}

.tou{
    margin: 0;
    width:100%;
    height:40px;
}

.bt{
    border: 1px solid rgb(204, 204, 204);
    width: 100%;
    height: 32px;
    border-collapse: collapse;
    line-height: 32px;
    background-color: #d6dde6;
    color: #272727;
    font-size: 16px;
    cursor: default;
}

.bt th{
    border: 1px solid #fff;
    text-align: center;
    line-height: 32px;
    height: 32px;

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值