Pycharm_Django_Html写法

按钮

<td><button>添加</button></td>

 

单选按钮写法<td>

  <input type="radio" name="gender" checked="checked">男
<input type="radio" name="gender">女
</td>
#checked 为默认选择



占位符写法
<td><input type="text" placeholder="请输入姓名"></td>



下拉框循环遍历写法
{% for d in d_all %}
<option value="{{ d.name }}">{{ d.name }}</option>
{% endfor %}


跳转
<td colspan="6" align="center"><button><a href="{% url 'add' %}">添加</a></button></td>
posted @ 2021-04-01 17:58  沈海  阅读(114)  评论(0)    收藏  举报