sethyuan / logseq-plugin-another-embed

This plugin provides 2 extra ways to embed blocks/pages.
MIT License
22 stars 1 forks source link

Resizing tables at runtime #17

Open stdword opened 9 months ago

stdword commented 9 months ago

I've made some changes for tables resizing:

  1. Changing certain column's width affects all others columns (and all col-w-X props should be saved)
  2. Resizing at runtime (to see results immediately)

Demo

Before After

This solution based on logseq-custom-files. But I can create a PR with its integration to this plugin. What do you think? Should I do that?

sethyuan commented 9 months ago

Thanks for the effort, I think 2 is great to have, but I have some concerns about 1, if all columns width are also persisted, the table will lose its own auto column width algorithm when further adjusting a column.

stdword commented 9 months ago

Yes, and this is an idea: if user starts to adjust the columns — the auto adjusting doesn't required any more for particular table.

These points only make sense (to me) together.

sethyuan commented 9 months ago

I don't think so, say your viewport is 800px now, after fixing the width of one column, you enlarged the viewport width to 1200px (via t w perhaps), with the auto adjusting behavior of the table itself, it will display OK, but if all columns are assigned a width then it will not display OK.

stdword commented 9 months ago

This is interesting: when width of ALL columns set to fixed pixels — its sizes changes relatively to whole table width. Just like none of the columns are fixed-width:

sethyuan commented 9 months ago

Oh my! But this defeats the purpose of setting a fixed width to a column, isn't it?

stdword commented 9 months ago

No: we are adjusting column width with respect to each other. A proportion, not a pixels. It is better to use % instead of px.

Well, I realize, it is a bit another feature.

sethyuan commented 9 months ago

No: we are adjusting column width with respect to each other. A proportion, not a pixels. It is better to use % instead of px.

Well, I realize, it is a bit another feature.

Agreed!