0

Add Div before table when using datatable

$('table').wrap('<div class="scroll_table"></div>');
9
  • Why dont you create a div over the table´s div? You can append whatever you want in it for after calling your datable´s stuff... Commented Jul 23, 2016 at 6:48
  • i want to add table with content within new div Commented Jul 23, 2016 at 7:00
  • You can call your datable´s data in your innerhtml table´s div (span, p table works as well...) <div id="div" class="scroll_table"> <div id="table"></div> </div> Commented Jul 23, 2016 at 7:07
  • please see first datatable work flow Commented Jul 23, 2016 at 7:13
  • 1
    Ok, so you're saying that instead of creating a table and enclosing it in a div (which is what your code does), you want to create a div and put a table inside it? Commented Jul 23, 2016 at 19:53

1 Answer 1

1

The dom element can be manipulated as per the following documentation to wrap divs around a lot of the data tables functionality including the table itself https://datatables.net/reference/option/dom

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.