td with 2 spans

td with 2 spans

troyleetroylee Posts: 10Questions: 5Answers: 0

Description of problem: I want a td to have 2 spans because I want to display two texts: a main text that represents the actual value that should be used by the DataTable and a sub text that represents some description.

1. Is it possible to sort based on a child of a td (in this case, it would be the main text span)
2. I'm planning to display the spans side-by-side (setting float:left and float:right respectively). Will the DataTable size the column and row height accordingly?

If there are any other ways to do any of this please let me know!

This question has an accepted answers - jump to answer


  • colincolin Posts: 12,910Questions: 0Answers: 2,200
    Answer ✓

    You can use columns.render to determine what value is used for the sort - you just return the string that DataTables will use. And for the sizing, it should do, but hard to say without seeing it.

    You could also consider child rows, they could also be used to display that additional information,


Sign In or Register to comment.