ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Make HTML Table Last Row Text bold using AngularJS in ASP.Net MVC<p>Hi <a class="username" rel="mahesh213">mahesh213</a>,</p> <p>Apply CSS property to the last row.</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">Controller</span></strong></p> <pre class="brush: csharp">public class HomeController : Controller { // GET: /Home/ public ActionResult Index() { return View(); } public JsonResult GetEmployees() { List&lt;object&gt; employees = new List&lt;object&gt;(); employees.Add(new { Id = 1, Name = &#34;John Hammond&#34;, Country = &#34;United States&#34; }); employees.Add(new { Id = 2, Name = &#34;Mudassar Khan&#34;, Country = &#34;India&#34; }); employees.Add(new { Id = 3, Name = &#34;Suzanne Mathews&#34;, Country = &#34;Russia&#34; }); employees.Add(new { Id = 4, Name = &#34;Robert Schidner&#34;, Country = &#34;France&#34; }); return Json(employees, JsonRequestBehavior.AllowGet); } }</pre> <p><strong><span style="text-decoration: underline;">View</span></strong></p> <pre class="brush: html">&lt;link rel=&#34;stylesheet&#34; href=&#34;https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css&#34; /&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; &nbsp;&nbsp;&nbsp; var app = angular.module(&#34;MyApp&#34;, []); &nbsp;&nbsp;&nbsp; app.controller(&#34;MyController&#34;, [&#39;$scope&#39;, &#39;$http&#39;, function ($scope, $http) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $http.get(&#34;/Home/GetEmployees&#34;) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .then(function (response) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; response.data.length; i++) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (i == response.data.length - 1) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $scope.LastRecord = response.data[i]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $scope.Employees = response.data; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }); &nbsp;&nbsp;&nbsp; } ]); &lt;/script&gt; &lt;div ng-app=&#34;MyApp&#34; ng-controller=&#34;MyController&#34;&gt; &nbsp;&nbsp;&nbsp; &lt;table id=&#34;tblCustomers&#34; class=&#34;table table-responsive&#34;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;thead&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th ng-repeat=&#34;(header, value) in Employees[0]&#34;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{header}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/th&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/thead&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tbody&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr ng-repeat=&#34;row in Employees&#34;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td ng-repeat=&#34;cell in row&#34; ng-style=&#34;row == LastRecord &amp;&amp;{&#39;font-weight&#39;: &#39;bold&#39;}&#34;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;span&gt;{{cell}}&lt;/span&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tbody&gt; &nbsp;&nbsp;&nbsp; &lt;/table&gt; &lt;/div&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <table id="tblCustomers" class="table table-responsive"> <thead> <tr><!-- ngRepeat: (header, value) in Employees[0] --><th class="ng-binding ng-scope">Id</th><!-- end ngRepeat: (header, value) in Employees[0] --><th class="ng-binding ng-scope">Name</th><!-- end ngRepeat: (header, value) in Employees[0] --><th class="ng-binding ng-scope">Country</th><!-- end ngRepeat: (header, value) in Employees[0] --></tr> </thead> <tbody><!-- ngRepeat: row in Employees --> <tr class="ng-scope"><!-- ngRepeat: cell in row --> <td class="ng-binding ng-scope">1</td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope">John Hammond</td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope">United States</td> <!-- end ngRepeat: cell in row --></tr> <!-- end ngRepeat: row in Employees --> <tr class="ng-scope"><!-- ngRepeat: cell in row --> <td class="ng-binding ng-scope">2</td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope">Mudassar Khan</td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope">India</td> <!-- end ngRepeat: cell in row --></tr> <!-- end ngRepeat: row in Employees --> <tr class="ng-scope"><!-- ngRepeat: cell in row --> <td class="ng-binding ng-scope">3</td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope">Suzanne Mathews</td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope">Russia</td> <!-- end ngRepeat: cell in row --></tr> <!-- end ngRepeat: row in Employees --> <tr class="ng-scope"><!-- ngRepeat: cell in row --> <td class="ng-binding ng-scope"><strong>4</strong></td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope"><strong>Robert Schidner</strong></td> <!-- end ngRepeat: cell in row --> <td class="ng-binding ng-scope"><strong>France</strong></td> <!-- end ngRepeat: cell in row --></tr> <!-- end ngRepeat: row in Employees --></tbody> </table>https://www.aspforums.net:443/Threads/470902/Make-HTML-Table-Last-Row-Text-bold-using-AngularJS-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/470902/Make-HTML-Table-Last-Row-Text-bold-using-AngularJS-in-ASPNet-MVC/Wed, 04 Sep 2019 05:13:38 GMT