The following output:
Is delivered by the following code:
<table class="table container">
<tr>
<th class="col-md-1 text-center">
@Html.DisplayNameFor(Function(model) model.SurveyResults.FirstOrDefault().QuestionNum)
</th>
<th class="col-md-2 text-center">
@Html.DisplayNameFor(Function(model) model.SurveyResults.FirstOrDefault().QuestionText)
</th>
.
.
.
<th class="col-md-2">
@Html.DisplayNameFor(Function(model) model.SurveyResults.FirstOrDefault().Answers)
</th>
</tr>
@For Each item In Model.SurveyResults
@<tr>
<td class="col-md-1 text-center">
@Html.DisplayFor(Function(modelItem) item.QuestionNum)
</td>
<td class="col-md-2">
@Html.DisplayFor(Function(modelItem) item.QuestionText)
</td>
.
.
.
<td class="col-md-2">
@For Each ans In item.Answers
@ans.AnswerText
@ans.AnswerStats
@<br />
Next
</td>
</tr>
Next
</table>
In the Answers column the string in the parenthesis are the stats regarding the answer. I would like the stats to show up as another column to the right of the Answers. The answers will ultimately be of varying lengths, and the stats need to show up to the right lined up vertically. The code above will always show the stats at the end of the answer text, where ever that occurs.
I tried several ideas from SO and other forums, but couldn't figure out how to easily create 2 'sub-columns' within the Answers < td > element of each < tr > row. I want to stick with Razor/HTML code.