css для вывода результативной таблицы (требуется дополнение)

This commit is contained in:
2024-11-29 02:07:38 +03:00
parent 6867da5c06
commit c7c3f3b14f

View File

@@ -3,30 +3,54 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{{ header }}</title> <title>{{ header }}</title>
<link href="/static/css/main.css" type="text/css" rel="stylesheet"> <link
<link href="/static/css/output.css" type="text/css" rel="stylesheet"> href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<link
href="https://getbootstrap.com/docs/5.3/assets/css/docs.css"
rel="stylesheet"
/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</head> </head>
<body> <body>
<div class="logout"> <div class="row flex-nowrap justify-content-between">
<a href="{{ url_for('logout') }}"><button>Выход</button></a> <div class="col-1 pt-1"></div>
<div class="col-10 text-center">
<label class="display-5 fw-bold">{{ header }}</label>
</div>
<div class="col-1 d-flex justify-content-end align-items-center">
<a href="{{ url_for('logout') }}"><button class="btn btn-danger">Выход</button></a>
</div>
</div> </div>
<h1>{{ header }}</h1>
<!-- Output --> <!-- Output -->
{% if items %} {% if items %}
<table> <div class="row flex-nowrap justify-content-between">
<tr> <div class="col-3"></div>
{% for key in items[0].keys() %} <div class="col-6">
<th>{{ key }}</th> <table class="table">
{% endfor %} <thead class="table-dark">
</tr> <tr>
{% for item in items %} {% for key in items[0].keys() %}
<tr> <th>{{ key }}</th>
{% for value in item.values() %} {% endfor %}
<td>{{ value }}</td> </tr>
{% endfor %} </thead>
</tr> <tbody>
{% endfor %} {% for item in items %}
</table> <tr>
{% for value in item.values() %}
<td>{{ value }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="col-3"></div>
</div>
{% else %} {% else %}
<p>Информации не найдено</p> <p>Информации не найдено</p>
{% endif %} {% endif %}