# Slicer Style

Add styles to your slicers with the help of various built-in styles provided by DsExcel.

## Content

DsExcel Java enables uers to apply style to the slicers. While adding a slicer, users first need to create a slicer cache and then use the slicer cache created base on the column of the table or the pivot table.
The [ISlicerCaches](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/ISlicerCaches.html) interface in DsExcel Java holds all the slicer caches in the workbook.

## Set slicer to built-in style

You can set a slicer to built-in style by using the [setStyle](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/ISlicer.html#setStyle) method of the [ISlicer](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/ISlicer.html) interface.
In order to set slicer to built-in style, refer to the following example code.

```Java
// Create slicer cache for table.
ISlicerCache cache = workbook.getSlicerCaches().add(table, "Category", "categoryCache");

// Add slicer
ISlicer slicer = cache.getSlicers().add(workbook.getWorksheets().get("Sheet1"), "cate1", 
"Category", 30, 550, 100, 200);

// Set slicer style to built-in style.
slicer.setStyle(workbook.getTableStyles().get("SlicerStyleLight2"));
```