Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[heuristic-table-plugin]table-row/collum styling #33

Open
5 tasks done
xbot13 opened this issue Apr 13, 2021 · 4 comments
Open
5 tasks done

[heuristic-table-plugin]table-row/collum styling #33

xbot13 opened this issue Apr 13, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers pr-welcomed

Comments

@xbot13
Copy link

xbot13 commented Apr 13, 2021

Oath

I swear that I have completed these tasks before submitting:

  • I have read the README
  • I have checked that the feature request has not been reported yet
  • I have prefixed this issue title with the plugin suffix (e.g: [iframe-plugin]) depending on the affected plugin

Decision table

  • The change I am requesting is not concerning performance
  • The change I am requesting is not concerning code style, compliance with
    official guidelines and recommendations, third-party deprecations,
    refactoring or development tooling

Feature

Summary:

2 Props for injecting styling for row and/or collum of the table. As tagsStyles: { tr: {}} has no effect on style.

Idea:

2 new Props for TableRenderer, wich receive viewStyleProps for styling the TableFlexRowContainer/TableFlexCollumContainer respectively. This is especially usefull for styles like shadows that have to apply to the container.

example prop:

styleTableFlexRowContainer = {{
marginBottom: 5,
elevation: 15,
shadowColor: "rgb(0,0,0)",
shadowOffset: { width: 0, height: 12 },
shadowOpacity: 0.12,
shadowRadius: 24,
}}

example output:

Table-Light

@jsamr
Copy link
Collaborator

jsamr commented Apr 13, 2021

@xbot13 Certainly an interesting feature, but not as easy as it might seem.

Styling rows

Because of rowspan attribute support, there might be virtual rows encompassing nested rows. In the example below, we have one root virtual row (in red) and 3 nested rows (in green).

rowspan

An other issue is width computation. Each column width is computed through inspecting the content. If one would add padding to rows, this should be taken into account during width computation, while also taking into account virtualization.

One solution could be to only style the top-level virtual row, and extract any box model style for width computation. We might also want to prevent usage of specific styles such as horizontal margins, (min,max)width and (min, max)height...

Styling columns

That looks pretty hard since "column containers" are nested in rows.

Workaround?

You might be able to reach the same visual effect by styling individual cells conditionally. See how to achieve this here..

I'm totally open to PRs regarding this feature, but I don't have the bandwidth right now to implement this!

@xbot13
Copy link
Author

xbot13 commented Apr 13, 2021

First of all thanks for the quick response! I appreciate the library and your work.

Honestly I did not think about the rowspan at all. It really makes it a lot harder.

But I will definitely have a go at the workaround. And in case someone faces a similar problem, I will post the result here.

Can't wait for the stable release!

@jsamr
Copy link
Collaborator

jsamr commented Apr 13, 2021

@xbot13 Thank you so much for your feedback. Looking forwards to your findings!

@jsamr
Copy link
Collaborator

jsamr commented Apr 17, 2021

@xbot13 An alternative would be to export two components / split this lib in two, with a lot of the shared logic packed into a third lib (it's a monorepo, so easy to do). And one of these would not support cell spanning but allow line styling. But it's quite an endeavor and I'm not going to dive into it unless for a paid freelance gig! However, I'm still open to PRs.

@jsamr jsamr added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed pr-welcomed and removed help wanted Extra attention is needed labels Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers pr-welcomed
Projects
None yet
Development

No branches or pull requests

2 participants