html - 表格和表格渲染顺序倒置

标签 html css

我不知道为什么我的表格出现在表单元素下面。即使我把它放在 html 中的表单元素之上。谁有类似经历?

<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>

表格显示在表单元素下方。

最佳答案

参见 fiddle

您忘记关闭 <table>因此您的表格出现在 table 上方。欢迎加</table>在最后</tr>之后.

并且,this是你的代码的 fiddle 。查看 </table> 时的变化错过了.. ;)

关于html - 表格和表格渲染顺序倒置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34534675/

相关文章:

html - 图像未使用 CSS 全屏显示

html - 谷歌浏览器在不同的计算机上处​​理分页符的方式不同

html - CSS/HTML - 在手机上隐藏图像并使用替代文本

javascript - 如何在 iOS 上取消双击滚动手势?

html - 将产品图片与底部垂直对齐

css - 如何在 IE 中为 anchor 伪元素删除 css 中的下划线

javascript - 如何将 HTML5 页面加载到我的 HTML5 页面中?

javascript - CSS 样式不适用于第二个下拉菜单

Javascript/CSS -- 在点击无关元素时应用 css 样式

html - 调试讨厌的水平滚动