Answer the question
In order to leave comments, you need to log in
How to make a table with changeable id parameters in Jade?
I'm trying to figure out how to create this block of html code in Jade:
<table>
<tr>
<td>1.</td>
<td>Перывй вопрос по 5-бальной шкале</td>
<td>
<div class="radios">
<input type="radio" name="question1" id="q1a11" value="1"><label for="q1a11" class="radio">1</label></input>
<input type="radio" name="question1" id="q1a12" value="2"><label for="q1a12" class="radio">2</label></input>
<input type="radio" name="question1" id="q1a13" value="3"><label for="q1a13" class="radio">3</label></input>
<input type="radio" name="question1" id="q1a14" value="4"><label for="q1a14" class="radio">4</label></input>
<input type="radio" name="question1" id="q1a15" value="5"><label for="q1a15" class="radio">5</label></input>
</div>
</td>
</tr>
<tr>
<td>2.</td>
<td>Второй вопрос по 5-бальной шкале.</td>
<td>
<div class="radios">
<input type="radio" name="question2" id="q2a11" value="1"><label for="q2a11" class="radio">1</label></input>
<input type="radio" name="question2" id="q2a12" value="2"><label for="q2a12" class="radio">2</label></input>
<input type="radio" name="question2" id="q2a13" value="3"><label for="q2a13" class="radio">3</label></input>
<input type="radio" name="question2" id="q2a14" value="4"><label for="q2a14" class="radio">4</label></input>
<input type="radio" name="question2" id="q2a15" value="5"><label for="q2a15" class="radio">5</label></input>
</div>
</td>
</tr>
</table>
(tr>td>{$.}^td>Сюда вопрос.^td>div.radios>(input:r[id=question$a$$ name=question$ value=$]label>label[for=q$a$$ class=radio]{$})*5)*28
- var q = 0
ul
while q < 24
tr
td= q++
td="Вопрос"
td
div.radios
- for (var x = 10; x < 15; x++)
input(type=radio, value='#{q}', id='q#{q}a#{x}')
label(for='q#{q}a#{x}, class='radio')#{x}
Answer the question
In order to leave comments, you need to log in
- var q = 0
ul
while q < 24
tr
td= q++
td="Вопрос"
td
div.radios
- for (var x = 10; x < 15; x++) {
input(type=radio, value='#{q}', id='q#{q}a#{x}')
label(for='q#{q}a#{x}, class='radio')#{x}
- }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question