title: Conflict with @Html.LabelFor and W3C Validator?
body: <p>I have a model that I am using to present an index of a model from a database and have given a display name to some of the rows that may need spaces in them, (I.e. "weekstarting" in a db would be given a display name of "Week Starting").</p>
  
  <p>So I set the display name for my model like this:</p>
  
  <pre><code> [DisplayName("Week Starting")]
      public DateTime WeekStarting { get; set; }
  </code></pre>
  
  <p>and then in the table headers for my table I use the following line of code to display the field name using its given display name:</p>
  
  <pre><code>@Html.LabelFor(x =&gt; x.First().WeekStarting)
  </code></pre>
  
  <p>The above all works fine. But I am using the W3C validator and it is giving me the following error for the example I have given: </p>
  
  <blockquote>
    <p>The for attribute of the label element must refer to a form control.</p>
  </blockquote>
  
  <p>Forgive me if it is obvious but what am I doing wrong here? I am not using a form I am simply displaying an index of items in a table. I have tried to look for an answer and saw someone suggest that the form controls being referred to need ids (even though I'm not using a form) but this would not be applicable in this instance because if I tried to set an id in the index it would be duplicated with each item in the index:</p>
  
  <pre><code>  foreach (var item in Model.Tbms)
  {
  &lt;tr&gt;&lt;td&gt;@item.value&lt;/td&gt;&lt;tr&gt;.... would be repeated for each item, and also unsure where I would put the id in any case, the td?
  }
  </code></pre>
  
  <p>Or is there a better way to label the field header, with my preferred display name in the first place? I guess I could just swap @Html.LabelFor... for  Hard code field name  but do I have to?</p>