html - 如何在两个子列中创建列
问题描述
我创建了带有标题(S、Incoming、Session..)的列和带有值的行(我从 Python 脚本中检索数据),但我不能在“队列”和“块”中划分列。
这是我的标题 html:https ://jsfiddle.net/Maestro1508/np239Lc0/4/
完整的html:
<li><span>Redis Status</span></li>
{% endblock %}
{% block content %}
<div id="main-content" class="col-12">
<h3>Redis Status</h3>
<div class="row">
<div class="col-12 like-a-table border-last-row">
<table class="table">
<thead>
<tr>
<th>Server</th>
<th colspan="2" style="padding-left: .5em;">Incoming</th>
<th colspan="2" style="padding-left: .5em;">Session</th>
<th colspan="2" style="padding-left: .5em;">KPI</th>
<th colspan="2" style="padding-left: .5em;">Export</th>
<th colspan="2" style="padding-left: .5em;">Thresholds</th>
<th colspan="2" style="padding-left: .5em;">AS Profile</th>
<th colspan="2" style="padding-left: .5em;">MP Profile</th>
<th colspan="2" style="padding-left: .5em;">First Beat</th>
</tr>
</thead>
<tbody>
{% for server, keys in redis_info.items %}
<tr id="{{ server }}">
<td> {{ server }} </td>
{% for item in keys %}
<td style="padding-left: .5em;">{{ item.0 }}</td>
<td style="padding-left: .5em;">{{ item.1 }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
解决方案
只需在您的第一个标题行下方添加另一行。您的第一行有 17 列,1 个单列 + 8 个双列。在第二个新行中,只需确保添加 17 个单列(即没有 colspan =2 属性)。
<tr>
<th>1. xxx</th>
...
<th>17. XXX</th>
</th>
推荐阅读
- c++ - 将记录推送到数据结构中的堆栈
- kubernetes - 干净地从 Kubernetes 中删除部署的正确方法是什么
- javascript - 无法从菜单触发关闭按钮单击事件
- javascript - 如何在 jQuery 或 JS 的 HTML 选择中多次选择相同的选项?
- docker - 如何解决 influxdb.conf 解析配置错误
- node.js - 在 http 调用之外获取结果
- java - 使用多个类并在单个类中正常工作时,一次全部输入时出错
- java - Java HMACSha1 WooCommerce 签名无效 - 提供的签名不匹配。","data":{"status":401}
- mysql - 错误 [InnoDB] mmap(137428992 字节)失败;错误号 12
- python-3.x - 在 Seaborn Countplot 中设置刻度