I need to adjust the layout of an existing <td>
in order to display a checkbox and one additional field on the same line. The current setup places these elements on separate lines. Below is the provided HTML code:
<!DOCTYPE html>
<html>
<body>
<table style="width:100%">
<tr>
<td>Jill</td>
<td>Smith</td>
</tr>
<tr>
<td>
<p>Timer<p/>
<input type="checkbox" id="checkBox" name="checkBox" size="30"/>
</td>
<td>
Please check the box
<td>
</tr>
</table>
</body>
</html>
The current output appears as follows:
Jill Smith
Timer Please check the box
[]
As highlighted, "Timer" and the checkbox are not aligned within the same row (inside the same <td>
).
If anyone can provide guidance on how to resolve this issue, it would be greatly appreciated.
Note: I am unable to modify the existing table format.
Explanation for timer being inside a paragraph element:
The Timer field is dynamic and requires a countdown from 20 to 0. Therefore, the <p>
element ID is necessary in JavaScript, though omitted here.