This is a migrated thread and some comments may be shown as answers.

[Solved] Can we control the width of 'tab' on top?

3 Answers 96 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nim
Top achievements
Rank 1
Nim asked on 18 Apr 2011, 04:09 PM
When testing the following codes:

<% Html.Telerik().TabStrip().Name("Test")
            .Items(tabstrip => {
                tabstrip.Add().Text("Test A")
                    .Content(() => {%>  A Content   <%});                
                tabstrip.Add().Text("Test B")
                    .Content(() => {%>  B Content  <%});                
            })
            .SelectedIndex(1)
            .Render();
%>

I wonder if there is any way to control the width of the tab "Test A" and "Test B" (on top).
For instance, can I make the width of tab "Test A" to be 30% width of the screen, while "Test B" to be 70% width of the screen, or set them with specific size?  Many thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 18 Apr 2011, 04:36 PM
Hello Nim,

Use HtmlAttributes for that:

tabstrip.Add().Text("Test A").HtmlAttributes(new { style = "width:250px" })

If you specify a percentage width, it will be calculated with regard to the component's width, not the screen width (unless the component is 100% wide).

All the best,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nim
Top achievements
Rank 1
answered on 18 Apr 2011, 04:51 PM
Thank you.
0
mahmoud
Top achievements
Rank 1
answered on 23 Apr 2011, 08:26 PM
and how about the "height" Dimo? 100% doesn't work for height  :-(
Tags
TabStrip
Asked by
Nim
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Nim
Top achievements
Rank 1
mahmoud
Top achievements
Rank 1
Share this question
or