0

I am attempting to add some table row spacing in my table. However I am not having much success. I can see my styles when I inspect the page, and they are not crossed out. Any ideas as to why I can't impose styles on my table? I have thoroughly read through some of the other vuetify posts for imposing css, but have had no success. Any thoughts?

Style:

`<style scoped>
    >>>tr {
        border-spacing: 10px;
        border:none;
    }

</style>`

Photo of console enter image description here

data table code

<template>
    <v-data-table :headers="headers"
                  :items="posts"
                  :items-per-page="5"
                  hide-default-header
                  item-key="post_id"
                  class="elevation-1 browseTable"
                  :footer-props="{
      showFirstLastPage: true,
      firstIcon: 'mdi-arrow-collapse-left',
      lastIcon: 'mdi-arrow-collapse-right',
      prevIcon: 'mdi-minus',
      nextIcon: 'mdi-plus'
    }">
        <template #item.full_post="{ item }">
            <p>{{ item.title }}</p>
            <p>{{item.body }}</p>
        </template>
    </v-data-table>
</template>

1 Answer 1

1

You should apply border-spacing to table, not tr. Also need to have border-collapse: separate; for this to work. Usually it's set to separate as default, but not sure if vuetify overwrites it

>>> table {
  border-spacing: 10px;
  border-collapse: separate;
}

As for the border: none, I suspect it's set on the td level. So if you want to affect that style, do:

>>> table td {
  border: none;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.