Create and work with the dgrid as usual, but add a second div below it which will contain the table.
Then set up the CSS to hide the print-only by default. Create a print.css file and the appropriate media attribute hide the no-print class and display the print-only.
Relevant lines of print.css
Relevant lines of admin.css (screen)
Link tag for the print.css file
<link media="print” href=’/css/print.css’ rel=’stylesheet’ type=’text/css’>
The hasNumber code is used to order the rows by a number in one of the columns.
This post courtesy of Worktrainer.