input[type=text]{
border:1px solid #ccc;
padding:.5rem .3rem;
}
input[type=text]:focus {
border-color:#42b983;
}
input{
outline:none;
}
tr:nth-of-type(odd) {
background-color:red;
}
tr:nth-of-type(even) {
background-color:#BCBCBC;
}
前端处理后端返回的数据方式:
var resule ='"; //定义一个空字符串
然后构建,即字符串拼接如:
result = "<div>"+data.name + "</div>";
最后append放入某个位置:
$('#div').append(result);
这种处理方式的缺点:代码量多了,维护起来特别的麻烦。改进方式 是使用模板引擎 具体查看相关视频。