Skip to content

Table with width 100% #97

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

Open
jjeising opened this issue Oct 25, 2020 · 0 comments
Open

Table with width 100% #97

jjeising opened this issue Oct 25, 2020 · 0 comments
Labels
question Questions about use, potential features, or improvements

Comments

@jjeising
Copy link

Support Question

Is there a trick to use regular-table with table { width: 100% }? I tried, because the table to replace used this, but then the initial render displays only two columns because view_state.viewport_width immediately exceeds the container – the first column has the full width after is is drawn:

https://github.com/jpmorganchase/regular-table/blob/8327abfd1f987721f18ab565702840b1c3938c1a/src/js/table.js#L171

After the first redraw this is fixed and behaves as expected.

Working arounds this with

table.addStyleListener(() => {
  table.getElementsByTagName('table')[0].style.width = '100%';
});

seems to work, but slightly changes the layout: the last column gets the remaining space instead of a more even distribution.

@timkpaine timkpaine added the question Questions about use, potential features, or improvements label Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions about use, potential features, or improvements
Projects
None yet
Development

No branches or pull requests

2 participants