<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="jquery-1.7.1.min.js"></script>
    <script>
        var list=[{'id':'1','国家':'中国','首都':'北京'},{'id':'2','国家':'美国','首都':'华盛顿'},{'id':'3','国家':'日本','首都':'东京'}]
        $(function () {
            var oldColor;
            $.each(list, function (index, content) {
                var tr = $('<tr></tr>').appendTo('tbody');
                tr.hover(function () {
                    oldColor = $(this).css('background-color');
                    $(this).css({ 'background-color': 'red', 'cursor': 'pointer' });
                }, function () {
                    $(this).css('background-color', oldColor);
                });
                $.each(content, function (key, value) {
                    $('<td>' + value + '</td>').appendTo(tr);
                });
            });

            $('tbody tr:even').css('background-color', 'yellow');
        });
    </script>
</head>
<body>
    <table border="1">
        <thead>
           <tr>
            <th>Id</th>
            <th>国家</th>
            <th>首都</th>
        </tr>
        </thead>
        
        <tbody>

        </tbody>
    </table>
</body>
</html>

最新文章

  1. CSharpGL(19)用glReadPixels把渲染的内容保存为PNG图片(C#)
  2. LeetCode#11. Container With Most Water
  3. JS中误用/g导致的正则test()无法正确重复执行
  4. [WPF系列]-DynamicResource与StaticResource的区别
  5. python %s深入解析
  6. 详细的图文教程来实现 eclipse环境下如何配置tomcat,并且把项目部署到Tomcat服务器上
  7. Exact Change(背包HDU2753)
  8. java读取某个文件夹下的所有文件
  9. 【数学相关、规律】Codeforces 696B Puzzles
  10. 高德地图教程_poi搜索和显示
  11. vuejs、eggjs全栈式开发设备管理系统
  12. pat1111-1120
  13. python3.6.4 tkinter安装
  14. Document APIs
  15. AD服务无法启动
  16. H5常用技巧
  17. Python3 tkinter基础 Menu add_cascade 多级菜单 add_separator 分割线
  18. poj2240
  19. Django开发笔记二
  20. Django 2.0.1 官方文档翻译: 文档目录 (Page 1)

热门文章

  1. 【34.25%】【BZOJ 2648】SJY摆棋子
  2. target属性值
  3. android Navigator的高度计算和推断是否显示
  4. 【C/C++学院】(23)Mysql数据库编程--C语言编程实现mysqlclient
  5. [React] Keep Application State in Sync with Browser History
  6. js进阶 9 js操作表单知识点总结
  7. 如何快糙好猛的使用libfacedetection库【最新版】
  8. SpringBoot集成PageHelper时出现“在系统中发现了多个分页插件,请检查系统配置!”
  9. Spring boot传统部署
  10. cordova-plugin-file-transfer 监听到下载成功,找不到文件 - 简书