Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8080167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:19:57+00:00 2026-06-05T16:19:57+00:00

ASP.NET MVC 3 can generate scaffold code for us(controllers and views). The generated views

  • 0

ASP.NET MVC 3 can generate scaffold code for us(controllers and views). The generated views by default use div and css layout.
But sometimes I need table layout views rather than div (as in default mode). How to generate table layout views like the following code? I also need the column number in a table row can be customerized.

My Question is: how to make asp.net mvc automatically generate talbe layout views for me. And more generally, how to modify the scaffold code template?

    <table>
    <tr>    
    <td class="editor-label">
        Id
    </td>
    <td class="editor-field">
        @Html.EditorFor(model => model.Id )
        @Html.ValidationMessageFor(model => model.Id)
    </td>
    <td class="editor-label">
        name
    </td>
    <td class="editor-field">
        @Html.EditorFor(model => model.Name)
        @Html.ValidationMessageFor(model => model.Name)
    </td>
    </tr>
    <tr> ... other fields go here ...  </tr>
    </table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:19:59+00:00Added an answer on June 5, 2026 at 4:19 pm

    I have never taken the time to override the T4 templates, but there are some blog post about the exact way to get to the templates and create/modify with your own layouts. The best example I could find is this blog post by Steve Sanderson

    http://blog.stevensanderson.com/2011/04/06/mvcscaffolding-overriding-the-t4-templates/

    It appears that you will need to override the Scaffolder “View” and the Create, CreateOrEdit, Edit templates. Once you run the command specified in the above post in the PM console line (see below)

    Scaffold CustomTemplate View Edit

    Then it will create a copy in your project which you can then modify and use as you wish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I write javascript code in ASP.NET MVC views, I can use @Url.Content() to
ASP.NET MVC can generate HTML elements using HTML Helpers, for example @Html.ActionLink() , @Html.BeginForm()
In ASP.net MVC 2, I can use routes.RouteExistingFiles = true; to send all requests
I have an ASP.NET MVC web app whose controllers use WCF to call into
In ASP.NET MVC how can I generate a URL to a specific controller and
I'd like to use the Razor View Engine outside of ASP.NET MVC to generate
With ASP.NET MVC (or using HttpHandlers) you can dynamically generate URLs, like the one
Related questions: ASP.NET MVC 3: Generate unobtrusive validation when BeginForm is on the layout
We are trying to use custom routes in an ASP.NET MVC application to generate
I am building a web site in C# using asp.NET MVC How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.