我創建一個web應用程序中的數據中,我有一個文本框:改變顏色,如果在表
<input type="text" style="height:30px; width:240px;" placeholder="Enter Data" />
...以及從我的web服務在angularjs
控制器讀取數據的表:
<table id="table" class="table table-bordered font" style="width:100%; margin-top:30px; background-color:white; padding-top:10px;">
<tr class="bg-primary textalign">
<th>Employee Name</th>
<th>From</th>
<th>To</th>
<th>Month</th>
<th>Year</th>
<th>Reason</th>
<th>Leave Id</th>
</tr>
<tr ng-repeat="x in sonvintable| filter:paginate" style="border: 2px solid #F3F3F3;">
<td style="border: 2px solid #F3F3F3;">{{x.empname}}</td>
<td style="border: 2px solid #F3F3F3;">{{x.from}}</td>
<td style="border: 2px solid #F3F3F3;">{{x.to}}</td>
<td style="border: 2px solid #F3F3F3;">{{x.month}}</td>
<td style="border: 2px solid #F3F3F3;">{{x.year}}</td>
<td style="border: 2px solid #F3F3F3;">{{x.reason}}</td>
<td style="border: 2px solid #F3F3F3;">{{x.leaveid}}</td>
</tr>
</table>
這是我的數據是如何顯示在我的表:
Employee Name From To Month Year Reason Leave Id
Alpesh Renuse 26-02-2016 27-02-2016 2 2016 Personal 353
Alpesh Renuse 09-05-2016 28-05-2016 5 2016 Personal 402
Alpesh Renuse 07-09-2016 10-09-2016 9 2016 Personal 441
如果用戶連接或者26
或2016
或者表中的任何東西,則必須改變特定<td>
的顏色。
使用'NG-class'和正則表達式來檢查列的值! –