TabPanel headers should occuppy entire TabView header area
I'm submitting a ... (check one with "x")
[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior TabPanel headers inside TabView do not occupy the entire header row of the View. If we have 2-3 tabs then there is lot of empty space towards the right.
Notice the enormous empty space after Tab#2. http://cdn.journaldev.com/wp-content/uploads/2014/08/TabView-Client-Side-Callbacks-OnShow.png
Expected behavior Provide an option for TabView to have all its child TabPanel headers to occupy the entire header row equally. This will consist of PrimeNG to calculate the width of TabPanel headers. Each new addition of a TabPanel will need to recalculate the width of TabPanel header so as to occupy the entire space.
What is the motivation / use case for changing the behavior? The TabView aesthetics should look good when the number of TabPanels are less.
Please tell us about your environment: Windows 10, VS 2017, NPM v3.10.9
-
Angular version: 4.1.0
-
PrimeNG version: 4.0.0
-
Browser: [all]
-
Language: [TypeScript 2.2.2]
-
Node (for AoT issues):
node --version= 7.2.0
That is how TabView component should look like.It won't cover full header area when there are less headers.
I understand your point of view. But, for some use-cases, sometimes, it's better to have the headers occupy the whole area. It looks especially odd with Ultima (the theme I use).
This is a matter of aethestics. In the case of primeng, I agree with their approach as it's a "standard" way to display tab panels. In your case, it won't look like a tab; it will end up looking like large pages.
You accomplish what you want with css though.
/* allows the ul to flex model properties */
.ui-tabview.ui-tabview-top>.ui-tabview-nav{
display:flex;
}
/* the li's will now always fill up the size of the ul's */
.ui-tabview.ui-tabview-top>.ui-tabview-nav li{
flex: 1;
}
example:

The CSS works great. Thanks @SIlver-- Closing this issue as of now. Hoping it gets implemented some day.
The CSS works great. Thanks @SIlver-- Closing this issue as of now. Hoping it gets implemented some day.
@smitpsanghavi Can you please share your sample code? I am unable to get it working.
Is it working for you guys for me its not working
/* allows the ul to flex model properties */
.ui-tabview.ui-tabview-top>.ui-tabview-nav{
display:flex;
}
/* the li's will now always fill up the size of the ul's */
.ui-tabview.ui-tabview-top>.ui-tabview-nav li{
flex: 1;
}
@SumitDIVVY and @ashishconex - This is the CSS you need that will work.
i tried this and it didn't worked i am on primeng 10
I am on PrimeNG 7 and cannot upgrade to PrimeNG 10 due to some constraints. You may need to modify the CSS selectors if they must've changed in v10.