Class: PandaCms::EditorJs::Blocks::Table

Inherits:
Base
  • Object
show all
Defined in:
app/lib/panda_cms/editor_js/blocks/table.rb

Instance Attribute Summary

Attributes inherited from Base

#data, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PandaCms::EditorJs::Blocks::Base

Instance Method Details

#renderObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/lib/panda_cms/editor_js/blocks/table.rb', line 5

def render
  content = data["content"]
  with_headings = data["withHeadings"]

  html_safe(<<~HTML)
    <div class="overflow-x-auto">
      <table class="min-w-full">
        #{render_rows(content, with_headings)}
      </table>
    </div>
  HTML
end