require 'daru/view' Daru::View.table_library = :datatables df = Daru::DataFrame.new({b: [11,12,13,14,15], a: [1,2,3,4,5], c: [11,22,33,44,55]}, order: [:a, :b, :c], index: [:one, :two, :three, :four, :five]) dt_df = Daru::View::Table.new(df, pageLength: 3) dt_df.show_in_iruby table_opts = { class: "display", cellspacing: "0", width: "50%", table_html: " Num1 Num2 Num3 " } options = { table_options: table_opts } html_code_dt_df = dt_df.table.to_html(id='table_id4', options) IRuby.html html_code_dt_df