<%@ page language="java" import="java.util.*" pageEncoding="gbk"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>jquery-Test1</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <script src="jquery/jquery-1.11.1.js"></script> <script src="jquery/jquery-1.11.1.min.js"></script> <script src="jquery/jquery.pagination.js" type="text/javascript"></script> <script src="jquery/jquery.pagination.js" type="text/javascript"></script> <link href="jquery/pagination.css" rel="stylesheet" type="text/css" /> </head> <script> $(document).ready(function(){ $("#AddBtn1").click(function(){ var str = ""; for(var i=0;i<3;i++){ str=str+"<tr><th>小王1</th><th>男</th><th>25</th></tr>"; } $("#table1").append(str); }); $("#DelBtn1").click(function(){ $("#table1 tr:gt(0)").remove();//列出 index 大于 0 的元素,也就间全部 }); //循环遍历 $("#s").click(function(){ var str = ""; var i = 3; $(this).each(function(i){ alert('a'+i); }); for(var i=0;i<5;i++){ alert('b'); } }); }); </script> <style> <%--tr {color: #FF0000; font-size; 13px}--%> th { border-width: 1px; padding: 2px; border-style: solid; border-color: #FF0000; } </style> <body> <table id="table1" style="width: 50%" bgcolor="#ffc" rules=rows cellspacing=0 align=left> <tr><th>Name</th><th>Sex</th><th>Age</th></tr> <tr><th>a</th><th>a</th><th>a</th></tr> <tr><th>a</th><th>a</th><th>a</th></tr> <tr><th>a</th><th>a</th><th>a</th></tr> <tr><th>a</th><th>a</th><th>a</th></tr> </table> </br></br></br></br></br></br></br> <button type="button" id="AddBtn1">添加行数据</button> <button type="button" id="DelBtn1">删除行数据</button> <button type="button" id="s">删除行数据</button> </body>
相关推荐
当表格数据较多时,会导致表头随内容滚动,影响使用,因此使用jQuery做一个插件,压缩文件中有test.html是一个具体使用的案例,如果不会使用请查看https://blog.csdn.net/qq_28254093/article/details/82844050 文章
In it, you'll learn how to traverse the DOM, handle events, perform animations, write jQuery plugins, perform Ajax requests, and even unit test your code. Its unique Lab Pages anchor each concept in ...
Jquery是继prototype之后又一个优秀的Javascrīpt框架。它是轻量级的js库(压缩后只有21k) ,它兼容CSS3,还兼容各种浏览器 (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)。jQuery使用户能更方便地处理...
在开发的过程中,经常会遇到弹出框显示前一页table列表的情况,这时候会有好多方法来来解决,有的人可能会说重新查一遍数据显示,有的人会说直接用js将值拷贝过去,然后再修改,不过现在就介绍怎么用jquery将值拷贝...
jQuery 解析表插件 这是一个简单的 ... jQuery("#test").parseTable({ success: function(data){ alert(data); }, cancel: function(){ alert('cancelled'); }, }); [removed] data是二维
演示 jQuery hide() 函数,隐藏 id="test" 的元素。 $("p").hide() 演示 jQuery hide() 函数,隐藏所有 <p> 元素。 $(".test").hide() 演示 jQuery hide() 函数,隐藏所有 class="test" 的元素。 jQuery 语法 ...
$ = layui.jquery; table = layui.table; tableIns = initTable(); }); //加载列表 function initTable(){ // 执行渲染 tableIns = table.render({ id: 'idTest', elem : '#deviceTable', // 指定原始表格元素选择器...
//必须提供2个table,而且第1个table的id必须为wzj_data_table //第2个的id必须为wzj_page_table,两个隐藏域名称必须为pageNumber和pageCount //第3步:确认引入了JS和CSS,test.jsp页面中的代码,严禁修改元素id。...
jQuery1.2 API 中文版折叠展开折叠全部展开全部 英文说明 核心jQuery 核心函数 jQuery(expression,[context]) jQuery(expression,[context]) 这个函数接收一个包含 CSS 选择器的字符串,然后用这个字符串去匹配一组...
行点击 描述 如果该行包含链接,则将可点击区域扩展到整个表格行。 ... ... <table> <td>Test Cell 1 <td><a>Test Cell 2</a></td> <td>Test Cell 3 </table> 必需的 JavaScript $('table').rowClick(); 链接
本文实例讲述了超级简单的jquery操作表格方法。...<table border=”1px id=”test” name=”test” class=”test” cellpadding=”0″ cellspacing=”0″ width=”20%”> ”1″>”30%”>1 ”30%”>2 <
简单载入js文件即可实现表头锁定功能呢。 此js基于Jquery。 相见包中demo文件夹 test.html 测试页面
本文实例讲述了Bootstrap table 服务器端分页功能实现方法。分享给大家供大家参考,具体如下: ...<table id=test-table class=col-xs-12 data-toolbar=#toolbar> function initTable(){ $('#te
周末写了个更改表格行顺序的小功能,直接贴代码 表格部分如下: 代码如下: <table class=”table” id=”test_table”> <thead> <tr> 时间</th> 详情</th> 操作</th> </tr> </thead> <tbody> ”7.0.0-2014-04-29_11-...
html代码(test.html),js在html底部 具体代码如下所示: <...test-jquery-ajax-list</title> </head> <body> <table> <th>id <th>name <th>sex <th>time </tabl
jquery需要的所有js文件 /*! * jQuery UI 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * ...
异步请求 var postData = { "env_name" : new_env_name, "env_url": new_env_url, "env_desc" : new_env_desc }; $.ajax({ type: 'POST', url : '/test_env_add/', ... $('#table_test_env').dataTable().fnC
一、创建表的测试数据: 代码如下: create table test(id int identity,title varchar(36)) declare @index int; set @index = 1; while(@index < 8888) begin insert test(title) values (newid()) set @ind
表格部分如下: 代码如下:<table class=”table” id=”test_table”> 时间 详情 操作 ”7.0.0-2014-04-29_11-02-24_123″ class=”list_line”> 2014-04-29 11:02:24
改编自php版本,原文: jQuery+PHP实现浏览更多内容http://www.helloweba.com/view-blog-130.html 这里记录...drop table [test] go CREATE TABLE [test]( [id] [int] IDENTITY(1,1), By 小M