
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 03:44 PM
I want to have different colors for each tab in my CMDB module. Is it possible to do so?
Please mark this response as correct or helpful if it assisted you with your question.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 04:19 AM
Hi Sanjiv,
Hope you are asking something as below.
You can achieve this by writing a on load client script on your table:
Script:
function onLoad() {
//Type appropriate comment here, and begin script below
var tabs = document.getElementsByClassName('tabs2_tab');
tabs[0].style.backgroundColor = 'red';
tabs[1].style.backgroundColor = 'green';
tabs[2].style.backgroundColor = 'orange';
tabs[3].style.backgroundColor = 'blue';
tabs[4].style.backgroundColor = 'yellow';
}
section numbers starts from 0. Replace the tab number with your required number to add color to that particular tab/section.
If you want to add colors to related lists as below , the next number will be followed in the script.
Please mark the answer as correct, if your issue is resolved

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2021 08:38 PM
I was wondering the same thing.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2019 03:23 AM
As you can see in this thread, there are ways to change tab colours with script. However, keep in mind that this is not inline with best practice. DOM manipulation is not recommended in ServiceNow since future UI upgrades are sure to break the script.
That said, there are many factors as to why this may or may not be a good idea. I would say go for it, as long as you keep in mind the cost and risk of maintaining this type of script.