I. Description
In the process of making reports, sometimes it is necessary to display the specified content in different colors to achieve the effect of highlighting. As shown below:
II.Ideas
Use rich text box or use HTML tags and HTML to display content
III.Examples
Note: In the methods described below, except for the rich text editing method, the last step of the other methods must use HTML to display the content!
1.Rich text editing
By inserting rich text, enter the content directly, and set the color.
2.Fixed color
Enter the content directly in the cell, and use the HTM L tag <font color='red'>red</font><font color='specified color'></font> to enclose the content to be colored. Then choose to display the content in HTML. To change the word red to red:
3.Use condition attributes
Set the condition attribute-new value and select the formula form. Enter the formula: replace($$$,"red","<font color='red'>red</font>"). In any case, you want the specified content to change color, so no conditions are set.
4.Use advanced properties to display values
In the cell element, select Advanced-display value, select formula form
5.Solve with SQL
Use the replace function in SQL to add HTML tags to the specified content.
IV. Effect preview
The effect in exporting Excel is as follows:
Note: You will find that the method of setting conditional attributes has no effect in exporting Excel, so it is generally recommended to use the other four.