I’m trying to add a header to the entire table, not just the first column. Currently we’ve been using a label and a table component separately. The closest I could get using only the table component was Table.props.headerGroups but it’s aligned to the columns. Maybe I’m missing something here.
If there’s a way to do it with the current setup, please let me know. If not, this is a suggested feature.
A while back I got a link to download project templates. I don’t have that handy but those templates included a page with this path “Page\Embedded\Title”. The top of each perspective screen would have an instance of that page which serves as a template for a title bar.
You can make a page that has one of those title bars and then a table below that. Then you simply embed an instance of that view in whatever view you want to display your table.
Layout is impacted by the layout type of the view so you might have to fiddle around with containers to get your intended layout.
I’m already using the idea of template for page (view) titles, but most pages have multiple tables. My point here is the table, not the view, and sometimes these tables have their own title/header and custom styles. So it doesn’t seem handy to be using templates for individual tables due to this customization. I mean, it could work, but it would be easier to have this configured in each table, a built-in property.
If this feature won’t be added, I’ll probably replace our current structure (two components) to what you mentioned. Thanks for your suggestion.
I agree that would be a useful feature.
I don’t think I am communicating well because what I said isn’t really what I’m trying to say You’re right it wouldn’t make sense to have a separate view for each table you want to display.
You can use a template of a “title bar” to display a label across the top of your table. Then you just put the “header” object down above your table inside a container for layout purposes. So you’re using the container that houses the label and the table to force the label to stretch across the top of the table.
It’s a little awkward because you need a container, title bar and table for each table but it’s not too bad.
Hi,
Did you figure this out? You can configure header groups on the table with one column that spans the width of all of the table columns by using the ‘span’ property. Sorry for the delay.
-Yousuf
Oh man. That was my fault. I was trying 1 and 0, thinking it was like span (all) or nothing. That’s why it didn’t work. That wasn’t a requirement in the project but it will definitely make my life easier to create and edit views.
Thank you so much.