How to customize the tab header width?

Hi team,

I'm having trouble with setting a responsive tab header as they are overcrowded, but setting the OverflowMode="OverflowMode.Scrollable"  didn't solve this problem, as all the headers are still rendered in the same container.

Is there a way to set the maximum number of tab header can be render in the tabs component? Or there is another way to set the tabheader width?

Cheers

3 Replies

AK Alagumeena Kalaiselvan Syncfusion Team March 25, 2020 10:56 AM UTC

Hi Feifan, 

Greetings from Syncfusion support! 

We have checked with your reported issue “How to customize the tab header width” and the Tab Scrollable mode enabled when the tab header overflows the container width otherwise the Tab header looks as normal even the overflow mode has been defined. So, you can resolve your issue by defining Tab Width property. We have prepared a sample for your reference. 

<SfTab OverflowMode="OverflowMode.Scrollable" Width="500px"> 
    <TabItems> 
        <TabItem Content="HyperText Markup Language, commonly referred to as HTML, is the standard markup language used to create web pages."> 
            <ChildContent> 
                <TabHeader Text="HTML"></TabHeader> 
            </ChildContent> 
        </TabItem> 
        <TabItem Content="C# is intended to be a simple, modern, general-purpose, object-oriented programming language. Its development team is led by Anders Hejlsberg. The most recent version is C# 5.0, which was released on August 15, 2012."> 
            <ChildContent> 
                <TabHeader Text="C Sharp(C#)"></TabHeader> 
            </ChildContent> 
        </TabItem> 
        ... 
   </TabItems> 
</SfTab> 

Also you can download this sample using the following link 

Kindly try out with shared solution and get back to us, If you need further assistance. 

Regards 
Alagumeena.K 



FE Feifan March 25, 2020 11:20 AM UTC

Hi Alagumeena,

Thank you for your reply. But what I meant to achieve is to set the width of tab item header 



not just set the width of whole tab and its content.

Regards,

Feifan


AK Alagumeena Kalaiselvan Syncfusion Team March 26, 2020 01:01 PM UTC

Hi Feifan, 

Thanks for your update! 

The Tab item header width can be customized by applying below styles in your sample. Refer the below code block for that 

<style> 
    .e-toolbar .e-toolbar-items .e-toolbar-item { 
        width: 60px !important; 
    } 
</style> 

Please let us know, If you have any complexities. 

Regards 
Alagumeena.K 


Loader.
Up arrow icon