Styling > Examples > Javascript tabs > only Initialization example code displaying

Styling > Examples > Javascript tabs > only Initialization example code displaying

dt_j@amdt_j@am Posts: 2Questions: 1Answers: 0

Under Examples > Styling (https://datatables.net/examples/styling/), the Javascript tabs only have the basic initialization of $('#example').DataTable(); The actual example JS code is missing. This is true for many of the Examples.

See this Example > Styling > Compact page to see what I'm referencing.
https://datatables.net/examples/styling/compact.html

Were the Styling Examples moved? Is this an error?
I need that Example code :smile:

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,177Questions: 26Answers: 4,923
    edited March 2021 Answer ✓

    the Javascript tabs only have the basic initialization of $('#example').DataTable(); The actual example JS code is missing. This is true for many of the Examples.

    Using $('#example').DataTable(); initializes a Datatable with default options. Nothing else is needed for the example.

    The example you linked states this:

    The compact class reduces the amount of white-space

    You can click the HTML tab to see the compact class being applied to the table.

    Were the Styling Examples moved?

    Are you asking about these?
    https://datatables.net/examples/styling/index.html

    The Styling docs are here if you need more information.

    Kevin

  • dt_j@amdt_j@am Posts: 2Questions: 1Answers: 0

    Thanks Kevin! I thought all options were set on the Javascript side of things where the datatable is initialized, and missed that those classes were being applied in the HTML tab. Appreciate the clarification!

This discussion has been closed.