Saeid
Saeid

Reputation: 13582

Template for display fields in two columns instead of one columns in MVC 3 Razor

The Details template of MVC 3 returned a view use <fieldset> to display elements that represent all fields in one column. But I need to show elements or fields of a model in two or more columns. Is there any good template for this? what is your suggestion?

Upvotes: 0

Views: 1776

Answers (3)

Erik Funkenbusch
Erik Funkenbusch

Reputation: 93444

There's nothing specific about MVC here. This is just plain old html and css. I suggest getting a good book on HTML and CSS, and these sorts of things will be clear to you.

One of many many many ways you could do it:

http://www.gethifi.com/blog/html-forms-the-right-ways

Upvotes: 1

Romias
Romias

Reputation: 14133

What you are looking for is modifying the Scaffolding Template that generated that view.

Or other option could be doing that manually, checking the best way to "display" each of your models.

Upvotes: 0

cecilphillip
cecilphillip

Reputation: 11596

One option you have is using editor templates for MVC, which allow you to take control of the how html rendering for a model is generated. Here's a blog post with an example

Using EditorTemplates in MVC 3

Upvotes: 0

Related Questions