I have a table where headers are dates formatted as moment().format('dd D MMM')
. Sometimes they can be wrapped and it's fine, but if any header was automatically wrapped I want to force other headers to be wrapped consistently.
The problem with inconsistent wrapping
| | Mo 5 | | We 7 | | | Sa 10 |
| Su 4 Oct | Oct | Tu 6 Oct | Oct | Th 8 Oct | Fr 9 Oct | Oct |
+-----------------------------------------------------------------+
I want it to be like this
| Su 4 | Mo 5 | Tu 6 | We 7 | Th 8 | Fr 9 | Sa 10 |
| Oct | Oct | Oct | Oct | Oct | Oct | Oct |
+-------------------------------------------------+
It becomes even worse with different scales when three lines in one cell appear. I'm wondering if there is a way to always have the same number of lines (equal to maximum) in all header cells
The table is a regular bootstrap table with no custom classes (I'm using bootstrap-vue)
<b-table striped borderless show-empty id="timeInputs" :items="items" :fields="fields" :sort-compare="tableSort"></b-table>
This is the code of the rendered table:
<table id="timeInputs" role="table" aria-busy="false" aria-colcount="9" class="table b-table table-striped table-borderless" aria-rowcount="13">
<!---->
<!---->
<thead role="rowgroup" class="">
<!---->
<tr role="row" class="">
<th role="columnheader" scope="col" tabindex="0" aria-colindex="1" aria-sort="none" class="">
<div>Name</div>
<span class="sr-only"> (Click to sort Ascending)</span>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="2" aria-label="Expand" class="">
<div></div>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="3" class="">
<div id="sun-header">Su 25 Oct</div>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="4" class="">
<div>Mo 26 Oct</div>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="5" class="">
<div>Tu 27 Oct</div>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="6" class="">
<div>We 28 Oct</div>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="7" class="">
<div>Th 29 Oct</div>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="8" class="">
<div>Fr 30 Oct</div>
</th>
<th role="columnheader" scope="col" tabindex="0" aria-colindex="9" class="">
<div>Sa 31 Oct</div>
</th>
</tr>
</thead>
...
</table>