title: Displaying data in table asp.net mvc?
body: <p>I want to show data events into a table 
  Before that i was able to show them without using a table inside 
  But now i want to show in a table 
  so far now i am able to do <a href="http://i.stack.imgur.com/EfTBg.jpg" rel="nofollow">this</a></p>
  
  <p>But i want to place "Faliure" under "Name" and 1st time in occur and second time in recover</p>
  
  <p>Here is my controller code where i am getting the events </p>
  
  <pre><code> SqlDataReader reader_events = event_command.ExecuteReader();
                  while (reader_events.Read())
                  {
                      events.Add(Convert.ToString(reader_events["Event_Name"]));
                      events.Add(Convert.ToString(reader_events["Occurrence_Time"]));
                      events.Add(Convert.ToString(reader_events["Recovery_Time"]).Replace("\n", Environment.NewLine));
                      //events.Add(string.Concat(Convert.ToString(reader_events["Event_Name"]) + " - " +" Occur " + Convert.ToString(reader_events["Occurrence_Time"]) + " - " + " Recover " + Convert.ToString(reader_events["Recovery_Time"]).Replace("\n", Environment.NewLine)));
  
                      //events.Add(string.Concat(" Power Failure " + " Event ID # " + Convert.ToString(reader_events["Event_ID"]) + " Device ID # " + Convert.ToString(reader_events["Device_ID"]) + " Occur at " + Convert.ToString(reader_events["Occurrence_Time"]) + " Recover at " + Convert.ToString(reader_events["Recovery_Time"]).Replace("\n", Environment.NewLine)));
                      //events.Add(string.Concat(" Power Failure " + " Event ID # " + Convert.ToString(reader_events["Event_ID"]) + ", Device ID # " + Convert.ToString(reader_events["Device_ID"]) + ", Occured " + Convert.ToString(reader_events["Occurrence_Time"]) + ", Recover " + Convert.ToString(reader_events["Recovery_Time"]).ToList().ToPagedList(page ?? 1, 5)));
                  }
  </code></pre>
  
  <p>i have passed the events in view data as </p>
  
  <pre><code> ViewData["events"] = events;
  </code></pre>
  
  <p>in my layout(view) i have done this </p>
  
  <pre><code> &lt;table class="table table-bordered table-responsive table-hover"&gt;
                    &lt;tr&gt;
                        &lt;th&gt;
                           Name
                        &lt;/th&gt;
                        &lt;th&gt;
                            Occur
                        &lt;/th&gt;
                        &lt;th&gt;
                            Recover
                        &lt;/th&gt;
                    &lt;/tr&gt;
                      &lt;tbody&gt;
                          @foreach (var item in ViewData["events"] as List&lt;string&gt;)
                          {
                              &lt;tr&gt;
  
                                  &lt;td style="border:1px solid black"&gt;
                                      @Html.DisplayTextFor()
                                      &lt;fieldset&gt;
                                          &lt;b style="text-align:center; width:22%; font-family:'Agency FB'; font-size:small; background-color:#C8E6C9; color:red"&gt;
  
                                          &lt;/b&gt;
                                      &lt;/fieldset&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          }
                      &lt;/tbody&gt;
                  &lt;/table&gt;
  </code></pre>
  
  <p>what i am missing? 
  any help will be appreciated </p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Here what i get </p>
  
  <p><a href="http://i.stack.imgur.com/y8UYY.jpg" rel="nofollow">error1</a></p>
  
  <p>Name is coming from one table while occur and recover from another table </p>