Giter Club home page Giter Club logo

Comments (12)

dextermb avatar dextermb commented on June 6, 2024 1

@NilesB raised a point about what if the column widths go over 100 in total, luckily for us the widths get scaled, here's a demo.

from react-dynamic-data-table.

DivineOmega avatar DivineOmega commented on June 6, 2024 1

Have you considered what to do if you do not want to specify a column's width in the middle of the table?

Maybe something similar to the following.

<DynamicDataTable
    rows={this.state.users}
    columnWidths={[10, 50, null, 10]}
/>

from react-dynamic-data-table.

DivineOmega avatar DivineOmega commented on June 6, 2024 1

@dextermb I much prefer this object format. 👍

from react-dynamic-data-table.

dextermb avatar dextermb commented on June 6, 2024

Have you considered what to do if you do not want to specify a column's width in the middle of the table?

Maybe something similar to the following.

<DynamicDataTable
    rows={this.state.users}
    columnWidths={[10, 50, null, 10]}
/>

I do prefer the array option, with using null. But it's worth raising this:

<DynamicDataTable
    rows={this.state.users}
    columnWidths={{
        id: 10,
        name: 50,
    //  email: null
        address: 10
    }}
/>

from react-dynamic-data-table.

dextermb avatar dextermb commented on June 6, 2024

cc @NilesB @AlexCatch @wheatleyjj @JacobBrassington

from react-dynamic-data-table.

dextermb avatar dextermb commented on June 6, 2024

@dextermb I much prefer this object format. 👍

Definitely more functional.

from react-dynamic-data-table.

JacobBrassington avatar JacobBrassington commented on June 6, 2024

Firstly i am assuming that the key's of the object would correspond to the column name? Secondly would this be in px or %?

cc @dextermb @DivineOmega

from react-dynamic-data-table.

DivineOmega avatar DivineOmega commented on June 6, 2024

@JacobBrassington Column names is correct, and I believe @dextermb was intending the values to be percentages.

from react-dynamic-data-table.

dextermb avatar dextermb commented on June 6, 2024

Firstly i am assuming that the key's of the object would correspond to the column name? Secondly would this be in px or %?

cc @dextermb @DivineOmega

As <td width> has been deprecated, which I did not notice, a style attribute would have to be added, this would be in percentages.

from react-dynamic-data-table.

JacobBrassington avatar JacobBrassington commented on June 6, 2024

It may be a good idea to make the table have an overflow: scroll on on the x axis for incase the user enters total values over 100%.

from react-dynamic-data-table.

dextermb avatar dextermb commented on June 6, 2024

It may be a good idea to make the table have an overflow: scroll on on the x axis for incase the user enters total values over 100%.

We could do, but the default behaviour is that table cell widths scale. So if they go over 100% then it still works out the difference. Here's the demo I posted further up. Maybe we set the overflow as a prop

from react-dynamic-data-table.

DivineOmega avatar DivineOmega commented on June 6, 2024

@JacobBrassington That functionality could be provided as another prop either specific to this case, or via a general style prop.

from react-dynamic-data-table.

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.