Html 把铅笔贴在右边
我想用铅笔将“状态”集中在图片上: 以下是html代码:Html 把铅笔贴在右边,html,css,django,Html,Css,Django,我想用铅笔将“状态”集中在图片上: 以下是html代码: {{ headers }} {% load i18n admin_static material_admin %} {% if results %} <div class="results"> <table id="result_list" class="table bordered highlight"> <thead> <tr> {% for
{{ headers }}
{% load i18n admin_static material_admin %}
{% if results %}
<div class="results">
<table id="result_list" class="table bordered highlight">
<thead>
<tr>
{% for header in result_headers %}
{% if 'action_checkbox' in cl.list_display and forloop.counter == 1 %}
<th class="action-checkbox">
{{ header.text }}<label for="action-toggle"> </label>
</th>
{% else %}
<th scope="col" {{ header.class_attrib }}>
{% if header.sortable %}
{% if header.sort_priority == 0 %}
<a href="{{ header.url_primary }}" data-turbolinks="false">{{ header.text|capfirst }}</a>
{% elif header.ascending %}
<a href="{{ header.url_primary }}" title="{% trans "Toggle sorting" %}" data-turbolinks="false"><i class="material-icons">arrow_upward</i>{{ header.text|capfirst }}</a>
{% else %}
<a href="{{ header.url_remove }}" title="{% trans "Remove from sorting" %}" data-turbolinks="false"><i class="material-icons">arrow_downward</i>{{ header.text|capfirst }}</a>
{% endif %}
{% else %}
<span>{{ header.text|capfirst }}</span>
{% endif %}
</th>{% endif %}{% endfor %}
<th style="text-align:right;" style='postion: relative; right: 500px'>{% trans "Status" %}</th>
{% if row_actions_template %}
<th style="text-align:right;">{% trans "Actions" %}</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for row in results %}
<tr class="{% cycle 'row1' 'row2' %}">
{% for item in row.cols %}
{{ item }}
{% endfor %}
<td class="material-icons">create</td>
{% if row_actions_template %}
<td class="row-actions">{% include row_actions_template with object=row.object %}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% include "loanwolf/pagination.inc.html" %}
{{headers}
{%load i18n管理\静态材料\管理%}
{%if结果%}
{result_headers%}中的头为%
{%if'action_checkbox'在cl.list_显示和forloop.counter==1%}
{{header.text}}
{%else%}
{%if header.sortable%}
{%if header.sort_priority==0%}
{%elif header.ascending%}
{%else%}
{%endif%}
{%else%}
{{header.text | capfirst}}
{%endif%}
{%endif%}{%endfor%}
{%trans“状态”%}
{%if行\操作\模板%}
{%trans“Actions”%}
{%endif%}
{results%%中的行的百分比}
{row.cols%中项目的%s}
{{item}}
{%endfor%}
创造
{%if行\操作\模板%}
{%include row_actions_template with object=row.object%}
{%endif%}
{%endfor%}
{%endif%}
{%include“loanwolf/pagination.inc.html”%}
这里的两个重要行是{%trans“Actions”%}
和创建
。我如何修改铅笔,使它可以在右边一点
我原以为我可以做创建
,但没有成功
提前谢谢
p.S.如果问题不清楚,请告诉我。不要将图标放在子表中。表格不用于布局,它们仅用于显示表格数据 而是将以下内容应用于包含操作按钮的表格单元格:
.actions {
text-align: right;
}
然后让你的图标成为一个锚定标签列表。我不得不对图标的结构及其类进行假设,因为您没有包含图标html:
<td class="actions">
<a href="#" class="icon icon-pencil">Action1</a>
<a href="#" class="icon icon-clipboard">Action2</a>
<a href="#" class="icon icon-plus">Action3</a>
</td>
锚定标记是“内联”元素,将响应
文本对齐
样式。表、div等是“块”元素,不能与文本样式对齐。您可以通过从DOM inspector复制html在这里发布一个片段吗?@Nimish抱歉,但我已经做了将近一周的html了。你能告诉我你的问题是什么意思吗?检查一下窗户。复制整个html并粘贴到代码段中。添加必要的css代码也。如果使用,不要忘记添加外部库。请阅读,特别是关于编写标题的部分。这不是一个好标题。而且,这不是普通的HTML。很明显,您正在使用某种模板框架。包括该标记,或显示呈现的HTML。