I am using a Display Template in my C# MVC4 application to structure how I want my custom model to be displayed in a datatable within my view. For the datatable, Im using datatables.net. In the following code I give each <td>
the class name "aligned", but when I run the application and inspect element the class name assigned has a blank space at the end such as "aligned "
@using System;
@model MyProject.Models.CellValueViewModel
<td class="aligned">
@{if(Model.Value.StartsWith("<input type='checkbox'"))
{
@Html.Raw(Model.Value);
}
else if(Model.Value == String.Empty)
{
@Html.Encode(0.00);
}
else
{
@Html.DisplayFor(x => x.Value);
}
}
</td>
Can anyone provide why this is happening?