Tbody

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr">
    
    <head>
        <style type="text/css">
            body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
        </style>
        <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"
        djConfig="parseOnLoad: true, isDebug: true">
        </script>
        <script type="text/javascript">
            dojo.require("dijit.form.Button"); // this is just to make the demo look nicer
            var arr = [{
                surname: "Washington",
                name: "Paul"
            },
            {
                surname: "Gordon",
                name: "Amie"
            },
            {
                surname: "Meyer",
                name: "Sofie"
            },
            {
                surname: "Jaysons",
                name: "Josh"
            },
            {
                surname: "Washington",
                name: "George"
            },
            {
                surname: "Doormat",
                name: "Amber"
            },
            {
                surname: "Smith",
                name: "Susan"
            },
            {
                surname: "Hill",
                name: "Strawberry"
            },
            {
                surname: "Washington",
                name: "Dan"
            },
            {
                surname: "Dojo",
                name: "Master"
            }];

            function filterArray() {
                var filteredArr = dojo.filter(arr, function(item) {
                    return item.surname == "Washington";
                });

                dojo.forEach(filteredArr, function(item, i) {
                    var li = dojo.doc.createElement("li");
                    li.innerHTML = i + 1 + ". " + item.surname + ", " + item.name;
                    dojo.byId("filtered-items").appendChild(li);
					
					var tr = dojo.doc.createElement("tr");
					var td = dojo.doc.createElement("td");
					td.innerHTML = "abc汉字";
					tr.appendChild(td);
					var td1 = dojo.doc.createElement("td");
					td1.innerHTML = "abc汉字a";
					tr.appendChild(td1);
					dojo.byId("myTbody").appendChild(tr);
					
					
                });

                dojo.forEach(arr, function(item, i) {
                    var li = dojo.doc.createElement("li");
                    li.innerHTML = i + 1 + ". " + item.surname + ", " + item.name;
                    dojo.byId("unFiltered-items").appendChild(li);
                });
            }
        </script>
        <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"
        />
    </head>
    
    <body class=" claro ">
        <button dojoType="dijit.form.Button" onClick="filterArray()" type="button">
            Filter array
        </button>
        <div style="width: 300px; float: left;">
            Filtered items
            <br />
            (only people with "Washington" as surname)
            <ul id="filtered-items">
            </ul>
        </div>
        <div style="width: 300px; float: left;">
            Unfiltered items
            <br />
            (all people are represented in the list)
            <ul id="unFiltered-items">
            </ul>
        </div>
        <!-- NOTE: the following script tag is not intended for usage in real
        world!! it is part of the CodeGlass and you should just remove it when
        you use the code -->
        <script type="text/javascript">
            dojo.addOnLoad(function() {
                if (document.pub) {
                    document.pub();
                }
            });
        </script>
        
        <table>
        	<thead>
            </thead>
            <tbody id="myTbody">
            	<tr><td>Table汉字</td></tr>
            </tbody>
        </table>
    </body>

</html>




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值