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:
http://www.bitsofsharepoint.com/ExamplePoint/Site/TabPage.aspx

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
msntab

Design 2: Yahoo
yahootab

Design 3: WebMD
webmdtab

Design 3a: WebMD Alt
webmdalttab

Design 4: Rounded Tabs 1
roundtab

Design 5: Rounded Tabs 2
round2tab

Drop me a comment if you found this useful!

Comments

chrisBaird said…
You are reading my mind, circa 6 months ago :-)
Unknown 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:(http://www.bitsofsharepoint.com/ExamplePoint/Site/TabPage.aspx)a 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. =)
Unknown said…
Erik,

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: http://www.bitsofsharepoint.com/ExamplePoint/Site/TabPage.aspx

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

Peter
www.bitsofsharepoint.com
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:
http://jqueryui.com/demos/tabs/
to deal with the cookies, check this link: http://stackoverflow.com/questions/2635998/jquery-sticky-tabs
Christophe said…
Erik,

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:
http://tinyurl.com/ET-CSS3
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.
ccampbell2074@yahoo.com
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.

Sincerely,
Tim
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?

thanks!
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…
Hi

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 (http://www.kaldeera.com)

Hope this helps.

Jake
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.
Derique Marie 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.
Unknown 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?

-Thanks
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?
Unknown 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?
Unknown 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 http://www.bitsofsharepoint2010.com/ExamplePoint/Pages/TabPage.aspx. 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

How To: Create Hyperlink to Modal Pop-Up Form

I was asked by a client recently if there was a way to create a hyperlink to a New Item Form anywhere within a site but still get the rich experience of the Modal pop-up window that grays out the background. (Note this is for SharePoint 2010 Only…) I basically took the code directly from the “Add new item” and the “Add Document” link within the list view. What this allows you to do is simply add in the following code to any content editor web part, Master page, or Page Layout in any site collection and display the form to be filled out. The user will get the nice experience of the modal window and not have to navigate away from their current page. This could be used for example a feedback form that is included in the master page so whenever someone wants to give feedback it is always going back to a central list. The only that is required for you to know is the List ID and the site name. Full Code For a List Item: <a onclick="javascript:NewItem2(event, &quot

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 Row Table Row Left Site Actions Navigate Up Edit Tab List Browse Page Table Row Right Give Feedback Welcome Menu Workspace Body Container Title Row Title

SharePoint 2013 Responsive Table Columns

I have been wanting to write this one for a while now. It is really amazing how UX is really finding is way into everything that we use and interact with. From Custom applications both mobile and on a desktop to document management or large data visualizations. There is always room for better usability and new concepts. SharePoint lists and library functionality really has not changed much for the past 10 years... I remember back in 2003 when I saw the same table/grid based views of documents and list items that exists in SharePoint 2013. But now we can look at them in a whole new way! In this video blog you will see how to create a responsive CSS table so that when the browser size is reduced it will hide specific columns. However hiding data is not always the right thing to do. What if a user needed those columns to filter on or to use for comparison to another document? Well that is where the custom jQuery Column chooser comes in. It allows you to see what columns are displ