哎,最近学的很烦,都不想敲代码了,准备写点小知识点,作为一个系列吧,括号内带t就是代表这个系列啦,会更新到我敲不动代码那天,先看代码,学习AngularJs中的小demo:
<body>
<div ng-app="myapp" ng-controller="myctrl">
<table width="90%" border="1">
<tr>
<th>序号</th>
<th>编号</th>
<th>名称</th>
<th>价格</th>
</tr>
<tr ng-repeat="product in products">
<td>{{$index+1}}</td>
<td>{{product.id}}</td>
<td>{{product.name}}</td>
<td>{{product.price}}</td>
</tr>
</table>
</div>
</body>
嗯。。。。没错,我就是不记得th标签的作用了 - -
遇到不懂得,当然是问度娘了,总结了一下,大概这几点:
1:th标签是table表格中的标题部分,就是每一列的表头用th包裹
2:th标签内文字带自动居中,加粗效果
3:td标签内的文字为左对齐的普通文本
ps:在 HTML 4.01 中,th元素的 “bgcolor”、”height”、”width” 以及 “nowrap” 属性是不被赞成使用的。
大概就这些吧,lalala