dom option: set both id and class for div

dom option: set both id and class for div

gagarskigagarski Posts: 4Questions: 2Answers: 0
edited July 2016 in Free community support

Hi.

I am trying to customize Datatables DOM and cannot figure out how to create div that has both class and id.
The following code in DOM:

<'#zzz yyy'><'yyy #zzz'>

produces the following HTML:

<div id="zzz yyy"></div><div class="yyy #zzz">

Example on https://datatables.net/examples/basic_init/dom.html says:

You can also specify div wrapping containers (with an id and / or class) to provide complete layout flexibility.

Is it really "and/or" or just "or"?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    From the page you linked to:

    • <"#id.class" and > - div with an id and class

    i.e. use a . rather than a space in your above code.

    Allan

  • gagarskigagarski Posts: 4Questions: 2Answers: 0

    Oops, looks like I missed it :)
    Nevertheless, I think it s also should be mentioned that on the reference page.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Agreed! Committed here and will be published on the site shortly.

    Thanks for pointing that out :smile:

    Allan

This discussion has been closed.