The search functionality searches across divs in a td, is there anything I can do about that?

The search functionality searches across divs in a td, is there anything I can do about that?

fobrienfobrien Posts: 2Questions: 1Answers: 0

Hi guys,

If I have a table that contains divs for styling purposes, I am finding that the Seach function returns rows that contain the end of one div, and the start of another. For example:

<table>
<tr>
<td>
<div>Foo</div>
<div>Bar</div>
</td>
</tr>
</table>

Putting "ooba" into the DataTables search bar will return that row. Is there any way to make the search treat those as separate entities, and therefore not come back in this example?

Thanks guys

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin
    Answer ✓

    Is there white space between the div's in your actual HTML? If so, that should really be all that is needed. DataTables is just striping out the tags. If there were no white space, then yes, I could see ooba matching that cell.

    Allan

  • fobrienfobrien Posts: 2Questions: 1Answers: 0

    Boom! Allan to the rescue. Thanks very much.

This discussion has been closed.