beercss / beercss

Build material design interfaces in record time... without stress for devs... πŸΊπŸ’›
https://www.beercss.com
MIT License
937 stars 47 forks source link

Sticky table header #241

Closed guidouil closed 5 months ago

guidouil commented 5 months ago

Hello Beer people, is there an easy trick to get an table header sticky when scrolling bellow ? I'm doing a data table and I would love the fixed property to work properly for the <th>. And every time I try to get something fixed the element on the right is pushed under the fixed element. I guess I'm doing something wrong but I can't put a finger on it. πŸ€”

Can someone throw me a ball ?

As a bonus, a way to enforce columns width on the table would be great πŸ™

leonardorafael commented 5 months ago

Hi @guidouil ,

Nice add and thanks for that 🍺 We will support fixed helper on <th>, <thead> and <tfoot> elements. At moment you can do like this codepen https://codepen.io/leo-bnu/pen/bGzMqyj (until next release).

About "column width", it's hard to standardize something like that. Maybe we can do the job, using our max, min, small, medium, large helpers on <th> and <td> elements. We need to think more about it.