jsDataTable :: JSONRow a => [a] -> UI (JSInit,Element)
jsDataTable as = do
  t <- UI.table #. "display"
  i <- identify t
  lt <- jsObjectT
    $ ffi "$(%1).DataTable(%2)" (selUID i)
    $ object
      [ "data"    .= as
      , "columns" .=
        [ object [ "data" .= c ]
        | c <- cs
        ]
      ]
  return (lt,t)
  where
  cs = colNames as
jsDataTable :: JSONRow a => [a] -> UI (JSInit,Element)
jsDataTable as = do
  t <- UI.table #. "display"
  i <- identify t
  lt <- jsObjectT
    $ ffi "$(%1).DataTable(%2)" (selUID i)
    $ object
      [ "data"    .= as
      , "columns" .=
        [ object [ "data" .= c ]
        | c <- cs
        ]
      ]
  return (lt,t)
  where
  cs = colNames as
jsDataTable as = do
  t <- UI.table #. "display"
  i <- identify t
  lt <- jsObjectT
    $ ffi "$(%1).DataTable(%2)" (selUID i)
    $ object
      [ "data"    .= as
      , "columns" .=
        [ object [ "data" .= c ]
        | c <- cs
        ]
      ]
  return (lt,t)
  where
  cs = colNames as