Happy-Coding-Clans / vue-easytable

A powerful data table based on vuejs. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.
https://happy-coding-clans.github.io/vue-easytable/
MIT License
3.71k stars 745 forks source link

Table which is expanded with another #439

Closed roma177 closed 2 years ago

roma177 commented 2 years ago

I have a table where rows are expanded with another tables like in the example here. https://happy-coding-clans.github.io/vue-easytable/#/en/doc/table/row-expand?anchor=expand-table Columns of a parent row have fixed width values, like width: '200px' Is there a way to make a cell of the child table in a given column to lie right under parent cell? Setting the same width for the parent columns and child columns does not help.

huangshuwei commented 2 years ago

Of course you can.

First of all,You need to set a fixed width for the parent table by style="width:900px" Refer to here

Then ou can set the left margin of the child table by style="margin:50px"

Here is an example :https://codesandbox.io/s/vue-easytable-2-13-0-example-forked-qoyp0?file=/Example.vue

roma177 commented 2 years ago

That example above actually shows something other, not what I meant. It has 4 parent columns and 5 child expanded columns. Moreover, child columns are clearly not positioned right under parent columns. I meant a case where for example there are 3 parent columns and 3 child columns. How to position the child column under the parent column, meaning all columns (child and parent) would have the same width.

huangshuwei commented 2 years ago

Do you mean the tree or nested table? This feature has been planned for development:https://github.com/Happy-Coding-Clans/vue-easytable/projects/3#card-74247964

huangshuwei commented 2 years ago

Repeat #377