Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I am using asp.net and asp.net and i try to design table in razor page using html and i get the data from the model .

so i am confusing because the user is enter the data in the table because the data will be change any time not static in the page .

this is table which i want to design .

Untitled — imgbb.com[^]

it is not fixed maybe the teacher has 1 day and one class or some time has 2 or 4 class in one day like this .

What I have tried:

This is my Code:

<table class="table table-bordered">
<tr>
    <th>
        @Html.DisplayNameFor(model => model.Group.Name)
    </th>

    <th>
        @Html.DisplayNameFor(model => model.Name)
    </th>
    <th>
        @Html.DisplayNameFor(model => model.Subject.Name)
    </th>
    <th>
        @Html.DisplayNameFor(model => model.Day.Name)
    </th>

    <th>
        @Html.DisplayNameFor(model => model.Hall.Name)
    </th>

    <th>
        @Html.DisplayNameFor(model => model.Schedule.Period)
    </th>
    <th></th>


</tr>

@foreach (var item in Model)
{
<tr>

    <td rowspan="2">
        @Html.DisplayFor(modelItem => item.Group.Name)

    </td>

    <td>
        @Html.DisplayFor(modelItem => item.Name)
    </td>

        <td>
            @Html.DisplayFor(modelItem => item.Subject.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Day.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Hall.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Schedule.Period)
        </td>

        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
            @Html.ActionLink("Details", "Details", new { id = item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.Id })
        </td>
    </tr>

}


Thank you
Posted
Comments
Richard Deeming 5-Nov-19 10:23am    
What does your model look like, and which cells are you trying to merge?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900