CodeforFun
CodeforFun

Reputation: 45

table and form render sequence inverted

i dont know why my table appeared below the form element. even though i put it above the form element in html. anyone has similar experience?

<h2>Current tasks</h2>
<div>
<table border="1" style="width:100%" class="task-db-table"><tr><th>Task</th><th>Start Date</th><th>End Date</th><th>Creation Date</th></tr><tr>
            <td>dghgt</td>
            <td>2015-12-30 11:02:00</td>
            <td>2015-12-31 23:12:00</td>
            <td>2015-12-29 09:09:36</td>
            </tr></div>
<h2>Insert</h2>
<div>
<form id="form" action="" method="post">
Task: <input type="text" name="task"><br>
Start date: <input type="datetime-local" name="startdate"><br>
End date: <input type="datetime-local" name="enddate"><br>
<input type="submit">
</form>
</div>

The table appears below the form element.

Upvotes: 2

Views: 33

Answers (2)

Lal
Lal

Reputation: 14810

See the fiddle

You forgot to close the <table> and hence your form appearing above the table. Kindly add </table> after the last </tr>.

And, this is the fiddle with your code. see the change when a </table> is missed.. ;)

Upvotes: 1

Froy
Froy

Reputation: 748

It looks like your missing the end table tag </table>

Upvotes: 0

Related Questions