0

Error: Misplaced non-space characters inside a table.

{% for birthday in birthdays %}↩

When I comment the jinja part outside the table data then it is fine. Should this just be ignored.

<head>
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
    <link href="/static/styles.css" rel="stylesheet">
    <title>Birthdays</title>
    <script src="static/nupp.js"></script>
</head>

<body>
    <div class="header">
        <h1>Birthdays</h1>
    </div>
    <div class="container">
        <div class="section">

            <h2>Add a Birthday</h2>

            <form action="/" method="Post">

                <input placeholder="Name" type="text" name="name"><br>

                <input placeholder="Month" type="number" name="month" max="12" min="1"><br>

                <input placeholder="Day" type="number" name="day" max="31" min="1"><br>

                <button type="submit">Submit</button>
            </form>
        </div>

        <div class="section">

            <h2>All Birthdays</h2>
            <form action="/delete" method="Post">
                <input class="delHidden" type="hidden" name="name" value="">
                <table>
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Birthday</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for birthday in birthdays %}
                            <tr class="hoverName">
                                <td>{{birthday.name}} <input class="delButton" name="{{birthday.id}}" type="submit" value="Delete"></td>
                                <td>{{birthday.month}}/{{birthday.day}}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</body>
2
  • are you validating this raw html or the rendered html? (should be the rendered html) Commented Mar 12 at 10:47
  • Thanks, I was indeed validating raw html.
    – RARob
    Commented Mar 13 at 7:28

1 Answer 1

0

My mistake was validating raw html, this leaves the Jinja code in place (validator reads it as an error). Instead I Loaded the page (Jinja code executed) and then copied the source into validator - no errors now.

1
  • please accept your answer since it answered your question
    – UpAndAdam
    Commented Mar 13 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .