Git Product home page Git Product logo

Comments (2)

huangshuwei avatar huangshuwei commented on May 25, 2024

当表格列的宽度之和小于表格宽度时,列宽会压缩。你可以尝试给表格最小宽度避免列宽压缩。形如:

<ve-table
            style="min-width:800px;"
            :columns="columns"
            :table-data="tableData"
        />

from vue-easytable.

appleqzw avatar appleqzw commented on May 25, 2024

当表格列的宽度之和小于表格宽度时,列宽会压缩。你可以尝试给表格最小宽度避免列宽压缩。形如:

<ve-table
            style="min-width:800px;"
            :columns="columns"
            :table-data="tableData"
        />

额,我的业务场景是:表格在一个右侧展开的抽屉弹框中展示,抽屉弹框的宽度是固定的,表格的宽度也就固定了(450px)
然后表格有蛮多列的,第一列的title就“日期”2个字,设置了word-break: keep-all;,然后出了横向滚动条,但是第一列显示的日期(yyyy-mm-dd这种格式)还是会换行,所以就想能不能有个最小宽度给第一列,让它宽度足够不用换行
目前是用

renderHeaderCell: ({ column }, h) => {
      return h('div', { style: { minWidth: '110px' } }, '日期')
},

word-break: keep-all;
来给第一列的表头的样式设置了个最小宽度,从而实现了最小宽度的效果,暂时先这么解决吧,如果有更好的方法也可以交流下~

from vue-easytable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.