I have created a simple custom list and name it as ‘My List‘
Modified the ‘Title‘ column name as ‘Student Name‘
Created one more column ‘Subject‘ which is of type single line text
Also, created one column ‘Marks‘ which is of type Number min is 1 and max is 100
Open the AllItems.aspx page using Sharepoint Designer 2007
Select the list, right click and Convert into XSLT mode
Write the XSL condition in between the ‘Subject‘ TD tag as show in the below image
Here goes the XSL code……
XSL condition in Sharepoint Designer 2007
Background color to Sharepoint Custom List column based on Marks
In this article, we will know how to change the color of a column based upon the values in the column. It is something like “Color Indicator” in SharePoint.
We have a custom list used for Project Tracking. In the list, we have column named STATUSfor tracking the project.
Whenever an item in the list is updated with the status in the column, then the background color of the status column should automatically change depending upon the status. Hence it gives a proper UI for tracking the status.
1. Create a custom list named “Project Tracking System” with the columns such as “Title”, “Description” and Status with the data type as shown below:
Columns with the data types to be created:
2. Now, we will insert 4-5 items in the list created.
In the above list, we can see that the status column is updated, but it would be good when we have background color of the each status separately. It is gives easy tracking to the users.
3. We can achieve this through JAVA SCRIPT.
4. Add a Content Editor Web part below the list as shown below:
5. Now in the content editor web part, add the below java script code (Open the tool pane -> Source Editor -> Place the Java Script -> Click Ok) and save the page.
6. Now, you can see the status column background is changed depending upon the status inserted for each item as shown below:
It is gives good interface to the users and also we can categorize the status easily.