Files
front/components/SpecialtyTable.vue
T
2026-09-26 19:30:59 +10:00

34 lines
1.0 KiB
Vue

<script setup lang="ts">
import type { SpecialtyTable } from "~/types";
/**
* Таблица специальностей учебного заведения.
* Ячейки поддерживают объединение по вертикали (rowspan), а переводы
* строк в тексте ЕГЭ отображаются переносом, как в исходной вёрстке.
*/
defineProps<{ table: SpecialtyTable }>();
</script>
<template>
<p v-if="table.caption" v-html="table.caption" />
<div class="table-responsive rounded">
<table class="table table-bordered">
<thead>
<tr>
<th v-for="column in table.columns" :key="column">{{ column }}</th>
</tr>
</thead>
<tbody>
<tr v-for="(row, rowIndex) in table.rows" :key="rowIndex">
<td
v-for="(cell, cellIndex) in row.cells"
:key="cellIndex"
:rowspan="cell.rowspan"
v-html="nl2br(cell.text)"
/>
</tr>
</tbody>
</table>
</div>
</template>