$ctrl.otherdata
是否可以根据<th>ABC</th>
<th>XYZ</th>
<th>PQR</th>
的长度
const string str = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Document><DocumentId>1</DocumentId><Attachment></Attachment><Metadata><DocumentType>0</DocumentType></Metadata></Document>";
var xml = new XmlDocument();
xml.LoadXml(str);
var node = xml.DocumentElement.SelectSingleNode("/Document/Metadata/DocumentType").InnerText;
DocumentType currentEnum = (DocumentType)Enum.Parse(typeof(DocumentType), node);
int currentEnumId = (int)currentEnum;
我试过但看起来它违反了网络标准,我尝试使用DIV,但看起来它不可能在表中,所以任何其他替代方案?
检查附图:这就是我正在寻找使用角度js
的投掷循环答案 0 :(得分:2)
这应该有效 -
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th colspan="3" ng-repeat="din $ctrl.otherdata">{{d.name}}</th>
</tr>
<tr>
<th>User ID</th>
<th ng-repeat-start="x in $ctrl.otherdata">ABC</th>
<th>XYZ</th>
<th ng-repeat-end>PQR</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in $ctrl.somedata">
<td>{{data.name}}</td>
<td>{{data.x}}</td>
<td>{{data.y}}</td>
<td>{{data.z}}</td>
</tr>
</tbody>
</table>