189 8069 5689

bootstrap,jquery利用后台传入的json数据创建动态表格

  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  

    10多年的东城网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。成都营销网站建设的优势是能够根据用户设备显示端的尺寸不同,自动调整东城建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联从事“东城网站设计”,“东城网站推广”以来,每个客户项目都认真落实执行。

  2. <%  

  3. String path = request.getContextPath();  

  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  

  5. %>  

  6. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  

  7.   

  8.   

  9.   

  10.     

  11.     ">  

  12.       

  13.     My JSP 'showTeachers.jsp' starting page  

  14.       

  15.       

  16.       

  17.           

  18.       

  19.       

  20.       

  21.           

  22.       

  23.           

  24.        

  25.       

  26.     

  27.     

  28.     

  29.        

  30.           

  31.               

  32.         

  

  •           

  •           

  •     

  •   

  •     

  •   

  •       

  •     
      

  •   

  •     

  •     

  •     

  •        var $table=$('');  

  •     $(document).ready(function(){  

  •   

  •         $("#nav_top").load("nav/nav_top.jsp");  

  •         var s='${json}';    

  •         var s=eval("("+s+")");  

  •           

  •         createTable("table_teacher",s);  

  •     });  

  •       

  •       

  •       

  •         function createTable(div,s){  

  •        // var $table=$('');  

  •         $("div").append($table);  

  •         var $caption=$('jquery生成bootstrap表格');  

  •         $table.append($caption);  

  •         var $thead=$('');  

  •         var $trs=$('');  

  •         var $th2=$('姓名');  

  •         var $th3=$('年龄');  

  •         var $th4=$('电话');  

  •         var $th5=$('操作');  

  •         $trs.append($th2);  

  •         $trs.append($th3);  

  •           $trs.append($th4);  

  •          $trs.append($th5);  

  •         $thead.append($trs);  

  •         $table.append($thead);  

  •        for(var p=0;p

  •          create_tbody(s[p].id,s[p].name,s[p].tel_phone);  

  •        }  

  •         

  •     }  

  •     function create_tbody(td1, td2, td3){  

  •         var $tr = $('');  

  •         $table.append($tr);  

  •         var $td1 = $('' + td1 + '');  

  •         $tr.append($td1);  

  •         var $td2 = $('' + td2 + '');  

  •         $tr.append($td2);  

  •         var $td3 = $('' + td3 + '');  

  •         $tr.append($td3);  

  •         var $td4 = $('');  

  •         var $edit = $('编辑');  

  •         var $delete = $('删除');  

  •         $td4.append($edit);  

  •         $td4.append($delete);  

  •         $tr.append($td4);  

  •         $(document).on("mouseover", ".tr_content", function(){  

  •               

  •                 $(this).children().each(function(){  

  •                     $(this).find("span").show();  

  •               

  •                 });  

  •         });  

  •           

  •         $(document).on("mouseout", ".tr_content", function(){  

  •                 $(this).children().each(function(){  

  •                     $(this).find("span").hide();  

  •                   

  •                 });  

  •         });  

  •     }  

  •           

  •           

  •      

  •   

  •       

  •    

  •  


  • 网页名称:bootstrap,jquery利用后台传入的json数据创建动态表格
    分享链接:http://cdxtjz.cn/article/pijdpd.html

    其他资讯