Coder Social home page Coder Social logo

Comments (4)

komarovalexander avatar komarovalexander commented on July 23, 2024

Hi @zatopek-firstis it is default behavior of html table.
the reason of that is that you have 4 columns with 200px width (800px in total), but table width is 1100px - what is bigger than all columns width. in this case table is doing column width change to fill the all free space, as a result when you change the width of one column it recalculates free space and changes the width of other columns.
Solution is to have columns width what fills all table width space in total
https://stackblitz.com/edit/table-column-resizing-ts-dbhs9s?file=Demo.tsx

from ka-table.

zatopek-firstis avatar zatopek-firstis commented on July 23, 2024

Yes, you are right it is default behavior of table, but with set width of table and set width of columns it is only solved for initial state and with overresizing it "breaks". Our customers are unfortunately like that and it needs to be solved, so I guess I will be forced to do so.

In your demo, you just solved it for your amount of columns and width, but luckily I have huge monitor so I can show you how it behaves in my enviroment:

columns1
columns2

Like I said, the problem is that it programaticly changes the width of only one column:

resize1
resize2

The solution (and in my opinion the correct one), would be to change the width of both left and right column next to resizing point up to one of them has minimal width and then stop it.

Heres example what I have in mind:
https://demos.devexpress.com/MVCxGridViewDemos/Columns/ColumnResizing

Of course if you really do not want to do it and keep your behavior the same, which is understandable, let me know and me or one of my colleagues will have a look at it in our wrapper. If you would be interested in solution afterwards and maybe want to implement it, I think we will be open for it.

from ka-table.

komarovalexander avatar komarovalexander commented on July 23, 2024

@zatopek-firstis I will not customize the native behavior of html table for that case. As a solution you can have one buffer column without width and it will change it size while others will keep their fixed sizes https://stackblitz.com/edit/table-column-resizing-ts-xg5dms?file=Demo.tsx

from ka-table.

komarovalexander avatar komarovalexander commented on July 23, 2024

@zatopek-firstis btw there is another way to keep columns width: just remove min width from table https://stackblitz.com/edit/table-column-resizing-ts-kjhdaw?file=style.scss
this way table will have width based on columns width

from ka-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.