vue-componentvuetify.jsquasar-frameworkquasarvuetify-datatable

How can i set vertical text on q-table header quasar?


I'm trying to parse some excel sheets for my web project and in this q-table I need to set two columns with vertical text just like this example but when I try to rotate it changes all columns.


Solution

  •   {
        name: 'first',
        align: 'center',
        label: 'First col header',
        field: row => row.value
      },
      {
        name: 'second',
        align: 'center',
        label: 'Second col header',
        field: row => row.value
      },
      {
        name: 'third',
        align: 'center',
        label: 'Third col header',
        field: row => row.value
      },
      {
        name: 'fourth',
        align: 'center',
        label: 'Fourth col header',
        field: row => row.value
      },
    ]
    
     <q-table
          :rows="rows"
          :columns="columns"
          row-key="name"
        >
          <template v-slot:header-cell-second="props">
            <q-th :props="props">
              <span class="text-vertical">
                {{ props.col.label }}
              </span>
            </q-th>
          </template>
    
          <template v-slot:header-cell-third="props">
            <q-th :props="props">
              <span class="text-vertical">
                {{ props.col.label }}
              </span>
            </q-th>
          </template>
    </q-table>
    
    .text-vertical{
      writing-mode: vertical-rl;
      transform: rotate(-180deg)
    }