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 368789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:51:27+00:00 2026-05-12T13:51:27+00:00

I am using asp.net mvc and I am not sure how to approach this

  • 0

I am using asp.net mvc and I am not sure how to approach this problem. I have a table in my database and that has some fields in it.

I want to generate a table with this. So I first tried to make a html helper that would make the table and and all the stuff I need but I am finding it too hard to maintain and causing problem for the designers who would actually like to see the table so they can add something different to each row or column if they want.

Right now if they need something I have to go add it in the html helper for them. So its just not working and better to stick to a html table that uses scaffolding.

Now my problem is 2 of the columns in this database table are used for styling.

Like I might have this table

<table>
  <tr> <td style="font-color : color;> hi </td> </tr>
</table>

So see the actual color for font-color would be grabbed from that database. It is possible each row could have a different color.

So I am not sure how to set this nicely.

Like I could do something like this since I am using scaffolding

<table>
  <tr> <td style="font-color: <%= item.color %>> hi </td> </tr>
</table>

This just looks horrible(spaghetti code) and I think there should be another way.

So then I thought maybe I should make a html helper for table cells. But I am not sure how to do it.

at first I did something like this Html.TableCell("test","a"); first param is “id” and second is the “innertext” of the td.

But then I thought what happens if this is a super long text that will look so stupid and messy.

So then I thought maybe do what the begin form does that you can put it in a using statement or something but I don’t know how to make a html helper that can use a using statement.

I am just so lost of how to best make this that will look nice and still will look like a table.

Thanks

  • 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-05-12T13:51:27+00:00Added an answer on May 12, 2026 at 1:51 pm

    Well, you could make a PartialView and seperate the table from the main page making the main page look better I guess.

    The other approach might be to use pure CSS to position all the elements and then turn the whole table into a web control. That way your designers will be working with css rather than in your code.

    But what you have done is correct and I think it only looks like spaghetti because we moved out of this type of coding some time ago. it feels like you are moving back to the days of asp.

    Anyway, the second option is what I would be doing as it keeps the designers away from the code.

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

Sidebar

Related Questions

Using ASP.NET MVC 2.0, I have an actionlink that is used for comments on
I have a relatively simple ASP.net MVC 2 app that is using SubSonic. Everything
I'm using asp.net mvc 2 and I'm not sure howto structure the models and
I am using ASP.NET MVC with jQuery. I have the following MVC Action that
I am using asp.net mvc and I have a table with value. When the
Im using asp.net mvc 2. I have a model Supermodel that consists of 2
I wrote a site using ASP.NET MVC, and although it is not completely SEO
Using ASP.Net MVC on my Site.Master I have: <head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server />
Using ASP.NET MVC + jQuery : I need to use some values owned by
I have an application in Asp.net MVC where at some point I would like

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.