I have a attendance list of all student from a specific date to a end date.
but i have a data show like given beleow but i want to show this horizontly at front end. my code work fine for vertically reporting but i want to make it horizontally date wise. 

```
SID N   A   C   Date
 1  S1  0   1   2015-04-20
 2  s2  1   1   2015-04-20
 3  s3  0   1   2015-04-20
 4  s4  1   1   2015-04-20
 5  s5  1   1   2015-04-20
 1  s1  0   1   2015-04-21
 2  s2  0   1   2015-04-21
 3  s3  0   1   2015-04-21
 4  s4  0   1   2015-04-21
 5  s5  0   1   2015-04-21
 1  s1  0   1   2015-04-22
 2  s2  1   1   2015-04-22
 3  s3  1   1   2015-04-22
 4  s4  1   1   2015-04-22
 5  s5  0   1   2015-04-22
 1  s1  0   1   2015-04-23
 2  s2  0   1   2015-04-23
 3  s3  1   1   2015-04-23
 4  s4  1   1   2015-04-23
 5  s5  0   1   2015-04-23

```

Code is : 

```
var result = (from r in context.AllAttendances
              orderby r.Attend ascending
              where r.ClassId == model.SelectedBindClassDropdown
              select r).ToList();

List<ClassViewModel.AllStudentRow> model1 = new List<ClassViewModel.AllStudentRow>();

if (result.Any())
{
    foreach (var record in result)
    {
        var className = (
            from r in context.ClassTimes 
            where r.Id == record.ClassId 
            select new { className = r.Class })
            .FirstOrDefault();

        model1.Add(new ClassViewModel.AllStudentRow()
        {
            Id = record.Id,
            Name = record.Name,
            ClassName = className.className,
            ClassId = Convert.ToInt32(record.ClassId),
            Attend = Convert.ToInt32(record.Attend),
            time = Convert.ToDateTime(record.Date)
        });
    }

    model1 = model1.Where(stu => 
        stu.time >= Convert.ToDateTime(model.txtDate) && 
        stu.time <= Convert.ToDateTime(model.toDate)).ToList();

    obj.AllStudentRows = model1;
}

```

cshtml:

```
 <table>
        <tr>

            <th>Name</th>
            <th>Class Name</th>
            <th>Attend</th>
            <th>Time</th>

        </tr>
        @if (Model.AllStudentRows != null)
        {
            foreach (var objUser in Model.AllStudentRows)
            {
            <tr>

                <td>@objUser.Name</td>
                <td>@objUser.ClassName</td>
                <td>
                    @if (@objUser.Attend == 0)
                    { <label style="color:red">Absent</label> }
                    else
                    {<label style="color:green">Present</label> }
                </td>
                <td>@objUser.time.ToShortDateString()</td>
            </tr>
            }
        }else{<tr><td colspan="4">No records for this date</td></tr>}

    </table>

```

My requirement is 

```
Name | 20-04-2015 | 21-04-2015 | 22-0-2015 | 23-04-2015
s1       0             0            0            0
s2       1             0            1            0
s3       0             0            1            1
s4       1             0            1            1
s5       1             0            0            0

```

Let me know if anyone have some solution for this