如何在HTML表格中实现图像右对齐
P粉555696738
P粉555696738 2023-09-02 09:04:11
0
1
428
<p>我已经制作了一个Django网站,想要显示我的结果,就像在顶部有一个小表单。在左边有一个表格,我想在右边的表格中添加两个图片和另一列。我已经设计了一个图来更好地解释 - 在此输入图像描述</p> <p>现在我已经编写了表单1和表格的代码。我也会编写后端代码。我想知道如何编写图片和表单2的html代码,因为它们在表格的右侧。只要写任何html代码,它就会出现在表格下面。有人可以帮助在表格的右侧添加图片和表单2吗?</p> <p>我现在的html代码是-</p> <pre class="brush:php;toolbar:false;">*{% extends 'login/basic.html' %} {% block title %}Approval of count{% endblock title %} {% block body %} &lt;!-- &lt;div class=&quot;container my-5 px-2&quot;&gt; --&gt; &lt;form action=&quot;/approval&quot; method=&quot;post&quot;&gt;{% csrf_token %} &lt;!-- &lt;div class=&quot;container&quot; &gt; &lt;div class=&quot;form-group mx-5 my-3&quot;&gt; &lt;div class=&quot;form-group mx-5 my-3&quot;&gt; &lt;label class=&quot;my-3&quot; for=&quot;date&quot;&gt;Date&lt;/label&gt; &lt;input type=&quot;date&quot; id=&quot;date&quot; name=&quot;date&quot;&gt; &lt;/div&gt; &lt;label class=&quot;form-group mx-5 my-3&quot; for=&quot;servers&quot;&gt;Choose the server from - {{serverLst}}&lt;/label&gt; &lt;div class=&quot;form-group mx-5 my-3&quot;&gt; &lt;select name=&quot;serverName&quot; id=&quot;forserver&quot; size=&quot;4&quot; multiple&gt; {% for server in serverLst %} &lt;option value=&quot;{{server}}&quot;&gt;{{server}}&lt;/option&gt; {% endfor %} &lt;/select&gt; &lt;/div&gt; &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary mx-5 my-3&quot;&gt;Submit&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; --&gt; &lt;div class=&quot;row g-2&quot;&gt; &lt;div class=&quot;col-md&quot;&gt; &lt;div class=&quot;form-floating&quot;&gt; &lt;input type=&quot;date&quot; class=&quot;form-control&quot; id=&quot;floatingInputGrid&quot; name=&quot;date&quot;&gt; &lt;label for=&quot;floatingInputGrid&quot;&gt;Shift Date&lt;/label&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;col-md&quot;&gt; &lt;div class=&quot;form-floating&quot;&gt; &lt;select name=&quot;serverName&quot; class=&quot;form-select&quot; id=&quot;floatingSelectGrid&quot;&gt; &lt;option selected&gt;Server Name&lt;/option&gt; {% for server in serverLst %} &lt;option value=&quot;{{server}}&quot;&gt;{{server}}&lt;/option&gt; {% endfor %} &lt;/select&gt; &lt;label for=&quot;floatingSelectGrid&quot;&gt;Select your server&lt;/label&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&quot;col-md&quot;&gt; &lt;div class=&quot;form-floating&quot;&gt; &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary mx-5 my-2&quot; id=&quot;floatingInputGrid&quot;&gt;Submit&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;!-- tables --&gt; &lt;table class=&quot;table&quot; style=&quot;width:25%&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope=&quot;col&quot;&gt;User name&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt;Starting&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt;Ending&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt;Bonus&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;1&lt;/th&gt; &lt;td&gt;Mark&lt;/td&gt; &lt;td&gt;Otto&lt;/td&gt; &lt;td&gt;@mdo&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;2&lt;/th&gt; &lt;td&gt;Jacob&lt;/td&gt; &lt;td&gt;Thornton&lt;/td&gt; &lt;td&gt;@fat&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;3&lt;/th&gt; &lt;td colspan=&quot;2&quot;&gt;Larry the Bird&lt;/td&gt; &lt;td&gt;@twitter&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;!-- &lt;/div&gt; --&gt; {% endblock %}</pre> <ul> <li></li> </ul> <p>任何改进我的html代码的建议都将非常有帮助,如果有任何html错误,请忽略。</p>
P粉555696738
P粉555696738

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!