New to building front-end web and this will be my first time raising a question here. I am using Flask to try it out but my code seems a bit of a mess. Is there a simpler way to implement this code?
{% for data in dataList %}
<tr>
{% for d in data %}
{% if data.index(d) == 0 %}
{% if dataList.index(data) == 0 %}
<td> <input type="radio" name="option" value="{{d}}" checked> </td>
{%else%}
<td> <input type="radio" name="option" value="{{d}}"> </td>
{%endif%}
{%else%}
{% if d %}
<td> {{d}} </td>
{%endif%}
{%endif%}
{% endfor %}
</tr>
{% endfor %}