New Line in Blazor app

Anonymous
2023-11-17T12:10:03.5566667+00:00

Here is my quizzing app , coded in Blazor .

The below code gives me failed questions , which are contiguous I want to add display each question in next line.

https://github.com/KalyanAllam/Quizzing

<div class="app-title">
                 @("Questions incorrectly answered:")
           @for (int i = 0; i < failedIndex; i++)
    {
        @failedQuestions[i]
                    
                }
            </div>
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,495 questions
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 1,495 Reputation points
    2023-11-17T15:16:59.5033333+00:00

    If I understand correctly you want each @failedQuestions[i] item on a new line. If so, use standard HTML like the paragraph <p> tag or <div>.

    <div class="app-title">
        @("Questions incorrectly answered:")
        @for (int i = 0; i < failedIndex; i++)
        {
            <p>
                @failedQuestions[i]
            </p>
        }
    </div>
    
    
    
    0 comments No comments

0 additional answers

Sort by: Most helpful