首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何更改v-data-table行高

如何更改v-data-table行高
EN

Stack Overflow用户
提问于 2019-08-30 16:18:41
回答 1查看 4.1K关注 0票数 1

我有一个v-data-table的问题,我想减少行的高度来匹配dense。我尝试为每个模板设置负边距,但它不起作用。我尝试了很多方法,但没有找到任何解决方案。

谢谢!

代码语言:javascript
复制
.cell-height table tbody td, table tbody th {
        margin-top: -15%;
    }
代码语言:javascript
复制
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<template>
<v-data-table :headers="headersProjectConfig" :items="projectConfig" class="cell-height" hide-default-footer dense>
    <template v-slot:item.isSelected="{ item }">
        <v-checkbox v-if="item.selection"></v-checkbox>
    </template>
    <template v-slot:item.text="{ item }">
        <span>{{item.text}}</span>
    </template>

    <template v-slot:item.averageTO="{ item }">
        <v-text-field type="number" hide-details :rules="[v => !!v || 'This field is required']" required></v-text-field>
    </template>
    <template v-slot:item.averageMargin="{ item }">
        <v-text-field type="number" hide-details :rules="[v => !!v || 'This field is required']" required></v-text-field>
    </template>
</v-data-table>
</template>

EN

回答 1

Stack Overflow用户

发布于 2021-08-21 12:43:54

你到底想要达到什么目的?您可以只使用css。用于修改表行的tr

代码语言:javascript
复制
<style lang="css">
tr{
  height: 70px !important;
}
</style>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57723076

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档