level 2
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script>
for (var aPerson = [
['编号', '姓名', '年龄'],
[1001, '小明', 19],
[1002, '小强', 24],
[1003, '夯大力', 27],
[1004, '王小刚', 21]
], s = '<table width="800" border="1">', i = 0; i < aPerson.length; i++) {
s += '<tr' + (/小/.test(aPerson[i][1]) && aPerson[i][2] > 20 ? ' style="background-color:red;"' : '') + '>';
for (var j = 0; j < aPerson[i].length; j++) s += '<t' + (i ? 'd' : 'h') + '>' + aPerson[i][j] + '</t' + (i ? 'd' : 'h') + '>';
s += '</tr>';
}
document.write(s + '</table>');
</script>
</body>
</html>
2020年01月08日 11点01分
