GithubHelp home page GithubHelp logo

Comments (1)

catouse avatar catouse commented on June 5, 2024

数据表格2所支持的自动列宽是需要自己定义每列所占百分比来调整,无法像传统表格那样根据内容来进行调整。当启用自适应列宽功能时,所有没有指定宽度的列会平分剩余的水平空间,但仍然可以通过配置为列宽设置一个权值,使得拥有更大权值的列获得更多的空间。权值通过 列定义的 width 属性设置,必须小于 1。

$('#myDataGrid').datagrid({
    dataSource: {
        cols:[
            {name: 'time', label: '对局时间', width: 132},
            {name: 'hero', label: '英雄', width: 134},
            {name: 'action', label: '动作', width: 109},

            // target 列自适应,占据剩余列宽的 1/4
            {name: 'target', label: '目标', width: 0.25},

            // desc 列自适应,占据剩余列宽的 3/4
            {name: 'desc', label: '描述', width: 0.75}
        ],
    }
});

第二个问题,因为行高需要预先设定,所以也是不支持普通表格的 table-condensed 类。

from zui.

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.