Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

76
Vistas
Rompiendo la mesa por mes Thymealeaf

Buenas tardes. Prompt como medio de Thymealeaf para romper la mesa en meses. Ahora todo se muestra correctamente ordenado por fecha. Pero necesito que el comienzo de cada mes esté firmado con una cadena.

Enero.

datos de enero

Febrero

datos de febrero. Etc..

Código de tabla

 <table class="table table-bordered table-hover table-sm table-fit"> <thead> <tr> <th>Дата начала по плану</th> <th>Должность и подразделение</th> <th>Шт.ед.</th> <th>Причина</th> <th>Дата окончания</th> <th>Включение в план</th> <th>Статус факт</th> <th>Дата смещения плана</th> <th>Филиалы</th> </tr> </thead> <tbody> <div th:each="d : ${descrirtion}"> <tr class="table-light"> <td th:text="${#dates.format(d.start_date, 'dd.MM.yyyy')}"> </td> <td th:text="${d.position} + ' ' + ${d.subdivision}"></td> <td th:text="${d.staff_unit}"></td> <td th:text="${d.reason}"></td> <td th:text="${#dates.format(d.end_date, 'dd.MM.yyyy')}"> </td> <td th:text="${d.status_onit} ? 'Подтверждено':'Не подтверждено'"></td> <td th:text="${d.status_fact} ? 'Подтверждено':'Не подтверждено'"></td> <td th:text="${#dates.format(d.new_start_date, 'dd.MM.yyyy')}"></td> <td th:text="${d.name}"></td> </tr> </div> </tbody> </table>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Puede agregar un Map con la clave siendo el mes y el valor de la información para ese mes en su controlador.

 @GetMapping public String page(Model model) { Map<String, List<Description>> map = .... model.addAttribute("map", map); return "index"; }

Luego, en Thymeleaf, puede iterar en el mapa:

 <div th:each="element : ${map}"> <div> th:text="${element.key}">Month</div> <div th:each="d : ${element.value}"> <tr class="table-light"> <td th:text="${#dates.format(d.start_date, 'dd.MM.yyyy')}"> </td> <td th:text="${d.position} + ' ' + ${d.subdivision}"></td> <td th:text="${d.staff_unit}"></td> <td th:text="${d.reason}"></td> <td th:text="${#dates.format(d.end_date, 'dd.MM.yyyy')}"> </td> <td th:text="${d.status_onit} ? 'Подтверждено':'Не подтверждено'"></td> <td th:text="${d.status_fact} ? 'Подтверждено':'Не подтверждено'"></td> <td th:text="${#dates.format(d.new_start_date, 'dd.MM.yyyy')}"></td> <td th:text="${d.name}"></td> </tr> </div> </div>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda