Customization
Use custom CSS classes
You can change the look and feel of a pagination.
Related sample: Pagination. Styling (custom CSS)
Follow these steps:
- Add one or more CSS classes with the settings you need. Place them in the
<style>section of your HTML page or in a separate stylesheet. If you use a stylesheet, include it on the page:
<style>
.my_first_class {
/*some styles*/
}
.my_second-class {
/*some styles*/
}
</style>
- Specify the name of the class you created (or several class names separated by spaces) as the value of the
cssproperty in the Pagination configuration:
const pagination = new dhx.Pagination("pagination_container",{
css:"my_first_class my_second_class"
});
For example:
<style>
.custom {
--dhx-background-primary: #3A434A;
--dhx-background-secondary: #5e6d78;
--dhx-color-primary: #118d8d;
--dhx-font-color-primary: #fff;
}
</style>
<script>
const pagination = new dhx.Pagination("pagination_container", {
css: "custom dhx_widget--bordered dhx_widget--no-border_top",
data: list.data
});
</script>