Skip to main content

SharePoint Tab Web Part JQuery, Java, and CSS

I have been searching for a simple tab web part for SharePoint but mostly came up empty handed… I was looking for something that a user can easily drag and drop a web part onto a specific tab within the page. There are quite a few free tab web parts out there but most of them were not just quite what I wanted. I checked out the following Tab web part solutions.

  1. Easy Tabs: From Path To SharePoint
    • Pro: The tabs automatically take the name of the web part.
    • Con: There is no option to add more than one web part per tab, and the User Interface is not that intuitive.
  2. Zone Tabs: From MSDN
    • Pro: You have a lot of options for tab customization
    • Con: It’s a web part that you have to install on the server. From what I remember it’s not that easy to re-arrange the web parts on the page.

I finally found this article from Bits Of SharePoint Site:

His code was exactly what I needed. All I had to do was make a few adjustments of the HTML and create my own tab styles. The process to get this to work is you simply edit the page layout in the source link below (Code is already included in header control) and change the name of the tabs to what ever you want. You can have as many tabs as you want but if you go over 8 you will need to add more web part zones.

<li><a href="#tab-1" class="selected"><span>Tab1</span></a></li>
<li><a href="#tab-2" ><span>Tab2</span></a></li>
<li><a href="#tab-3" ><span>Tab3</span></a></li>

Once you have your tabs specified, simply choose what design you want. I created a few example designs that will get you started. To change the designs simply remove the commented out referenced style sheet and comment out the one you don’t want. You can place the support files anywhere you want but the links in the page layout point to the 12 hive: /_layouts/1033/styles/tabstyles/

For inspiration, I looked around the web and found a few unique styles that I wanted to replicate, and I also came up with a few of my own. Please download the Source Files HERE and give it a try!

Design 1: MSN

Design 2: Yahoo

Design 3: WebMD

Design 3a: WebMD Alt

Design 4: Rounded Tabs 1

Design 5: Rounded Tabs 2

Drop me a comment if you found this useful!


chrisBaird said…
You are reading my mind, circa 6 months ago :-)
rabih said…
great post.
but when i switch to another tab(ex:tab2) the same content in tab1 still appear in tab2.
i used it to display page content in each tab.
Anonymous said…
I found this site:( while ago, because I had the same issue as you. The "Easy Tabs and Zone Tabs" are not realy what I wanted. Now when you implement the Tabs from Peter Allen. Do you have any trouble to navigate within Folders on a Document Library? I mean, imaging you uploaded documents within Folders. At this point, everytime you open a Folder, IE do a refresh and cannot remember his last session (Navigate automatically back to Tab1). Do you have a solution for my problem? This is the reason why I didn't use Peter Allen great Tab Template and I want to use it. =)
Peter Allen said…

Nice work on the tabs, they look really good. I have updated my code so that tabs are sticky, so if you refresh the page it will stay on the tab vs. going back to the first tab.

View details here:

The tab, Code Update, has the instructions and code changes.

Sean said…
Hi Erik,
Your information is helpful, but I found that I need to put additional webpart, and others might found the trick when edit the webparts, so I give it up. I am using JQueryUI now.

Hi Anonymous, I had the same problem as you do. That's why I use JQueryUI instead:
to deal with the cookies, check this link:
Christophe said…

I just came across your post and your comments about my Easy Tabs.
Could you elaborate on your comment that the UI is not intuitive? I am currently working on new versions and I am willing to make the Easy Tabs better.
Also, note that an essential benefit of the Easy Tabs is that there is no external dependency (jQuery or other).
Anonymous said…
Quick update, a demo with styled Easy Tabs:
Cory said…
I'm currently the SharePoint 07 designer/admin for my company. I've had to learn Designer and SharePoint and am now looking for information on getting official training and certification. Can you provide any feedback on where to go for this and/or any useful websites to check out? I live in San Diego, CA btw. Appreciate any feedback. Thank you.
Tim Farrell said…
Hi Eric,

Great post. Just what I need.

The problem I am having is that whenever I add a web part to the page I get the following error:

The SPListItem provided is not compatible with a Publishing Page

Are there any other modifications to the page that must be made or does the page have to be stored in a certain library to work?

Thank you for your response.

Chetan said…
Does this work with SP 2010?
Does this work with SharePoint 2010?
If how then can you please tell me the Step By Step procedure to acheive this.
Jiehae said…
I am pretty new to SharePoint and had to figure out adding tabs to a page.
It worked beautifully! (@Chetan, we have SP 2010 and it worked!)

I just wanted to thank you for the awesome post.

One last thing.
I don't know how to apply the tab styles you posted. would you please tell me how to do it? or can you tell me what i should study to understand CSS?

Erik Swenson said…
Jiehae, to get the other styles to show just remove the Comment Brackets from the references CSS files and then put those same comment marks to the one that you do not want to use and the style should work with a refresh of the page. Im glad you were able to get it to work on 2010. There should be no reason why it should not work.
Anonymous said…
Is this supported in SP2010?
Doesn't seem to fit fluidly on the page.
Anonymous said…

This worked beatifully for me ;-)

I have one issue though:
The standard left navigation is missing

Any suggestions

/ geert larsen
Jake said…
In our SharePoint projects we use a tool to customize SharePoint forms: Advanced Forms for SharePoint (

Hope this helps.

Damon Lueck said…
Hi Erik, thanks for the tabs, I use them all over the place. Im having one small issue though and Im hopeful you have a quick solution- When a page is first loaded, the first tabe that is coded for class 'selected' does show that it is selected, but it doesnt have any content until you click on it. I have changed the code via one of the other posts to "remember" which tab is selected after the first visit, and then the tab content shows. But on the first page load the content isnt displayed. Do you know why or where to fix this? Thanks
Anonymous said…
Great post.

I think you meant to say 'SharePoint Tab Web Part JQuery, Java*script*, and CSS.
Anonymous said…
THANK YOU! (I really meant to use Caps).
CHM said…
I tried to download the code for the tabs and it looks like it is a dead link?
Erik Swenson said…
CHM, I did not see any issue with the download. What type of computer and opperating system are you using?
Anonymous said…
a dam question: my tabs cannot show content. I changed href="/lists/mylist/allitems.aspx", but nothing happend.

Is there more steps to do?
Anonymous said…
a dum question: my tabs cannot show content. I changed href="/lists/mylist/allitems.aspx", but nothing happend.

Is there more steps to do?
Anonymous said…
ok, problem solved. I just manually add jquery.js link. when i click a tab, i see a webpart zoon correspondes the same tab.
Dona Deri said…
I want to get a vertical view for these tabs instead of horizontal. Will the content of each tab still show horizontally or will it change the entire view of the page if I were to change the tabs to show vertically (up/down)?
Domsen said…
how can i add more webpartzones for more than 8 tabs?
ANIL said…
Can someone say how we can add the tabs to existing page.
Harold Liles said…
I downloaded your sample syltes and tabpage.aspx, but I want the tabbed zone at the bottom of the page. Is it easy to move that around?

Jovix said…
This was very useful to me, however I'm trying to use it with calendar views and it does not seem to work right. The calendar in the first zone renders fine, however the calendars on the other forms don't render the events correctly. The calendar entries show up in the top left corner. Has anyone else encountered this and solved it?
aparna john said…
Hi,Moreover, clients need their personal and financial details to remain private. As a result, it is essential to consist of security on the website.If a website is an e-commerce website, make the purchasing bag or seek the Web Design Cochin services of someone to do it for you.Thanks....
Ambalica said…
Hi, so I am already using it. But there is an issue I faced and i dont know if anyone else is facing it.
The tabbed pages appear for some users, but for some, all the 8 webparts appear on the same page! Did anyone face the issue?
Dave Francoeur said…
I am having difficulties getting this to work, can anyone lend a hand?
Darrell said…
I have a question. Does anyone know how to select the Tabs with a link or code? I have found that the anchors do not work. Even on the site where the code originated on If you type in the page with an anchor, such as #tab-2 or #tab-3. Any suggestions would help. Thanks!

Popular posts from this blog

SharePoint 2010 Base CSS Classes

This will be the first of many SharePoint 2010 posts. I will be focusing on a few of the main CSS classes used for SharePoint 2010 Public Beta. As the product becomes more final there might be some changes to the class names but I will be sure to create a new post if that happens. This will be quite a lengthy but it should be helpful. The default CSS given below are just highlights of the full CSS attributes for that class.I will be using a basic team site as my base for the screenshots. Here is a basic structure of the main areas that I will cover.Ribbon RowTable Row Left Site Actions Navigate Up Edit Tab List Browse Page Table Row Right Give Feedback Welcome Menu WorkspaceBody Container Title Row Title Title Logo Title Text / BreadcrumbPage DescriptionSocial Data SeparatorI like It Tags/Notes Top Header 2/Top Links li Static-Selected li Static SearchHelpStatus Bar Container Main A…

How To: Hide Left Side Navigation on Home Page

I was recently asked: "How can I hide the side nav bar on the main homepage layout ?? I want to be able to use the side NAV with in the team site etc etc, but I don't want it on the front page.. " There are a couple of ways to do this in SharePoint 2010. If you are using a non-publishing site you can add a Content Editor Web Part to the page and add the following to the HTML Source.
body #s4-leftpanel
display: none;
margin-left: 0px;
Basically the CSS above hides the left navigation Div, and then sets the content area to not have a left margin. Once you are done, simply modify the web part and hide it on the page. If you are using a publishing site for your homepage simply add the same styles specified above to a custom page layout. That way if you have a need for other pages that do not need the left side navigation you can re-use the page layout.

SharePoint 2010 Content Query for Blog Posts

I hope this post will help many of you feel comfortable with using the Content Query Web Part.In this post I will walk you through the process of creating a content query web part and configuring it to show custom field types. I will also give details on how to use XSLT to stylize and format the data being pulled. I will be using the following scenario as an example. Say that you had a site collection with a top level publishing site. This publishing site would display a the most recent blog posts from all blog sites within its own site collection. To solve this problem we will use a Content Query Web Part and a customized ItemStyle.xsl using XSLT.Please note that the “SharePoint Server Publishing Infrastructure” needs to be enabled at the site collection to display the content query web part.Step 1: Add a Content Query Web Part to PageNavigate to the site that you want the blog posts to show up and click on edit page. Under Editing Tools in the Ribbon, Click on insert > Web PartUn…