grapesjs-table-component
v1.0.2
Published
Grapesjs Table
Downloads
153
Readme
Grapesjs Table
Table component plus block, with abstracted properties for easier editing.
HTML
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-table-component"></script>
<div id="gjs"></div>JS
const editor = grapesjs.init({
container: '#gjs',
height: '100%',
fromElement: true,
storageManager: false,
plugins: ['grapesjs-table-component'],
});CSS
body, html {
margin: 0;
height: 100%;
}Summary
- Plugin name:
grapesjs-table-component - Components
table
- Blocks
table
Options
| Option | Description | Default |
|-|-|-
| id | Block and component ids | table |
| label | Block label | Table |
| category | Block category | Basic |
| block | Extend default block | {} |
| cellDefaults | Extend component default properties | {} |
| cellModel | Extend component model | {} |
| tableDefaults | Extend component default properties | {} |
| tableModel | Extend component model | {} |
Download
- CDN
https://unpkg.com/grapesjs-table-component
- NPM
npm i grapesjs-table-component
- GIT
git clone https://github.com/Ju99ernaut/grapesjs-table-component.git
Usage
Directly in the browser
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-table-component.min.js"></script>
<div id="gjs"></div>
<script type="text/javascript">
var editor = grapesjs.init({
container: '#gjs',
// ...
plugins: ['grapesjs-table-component'],
pluginsOpts: {
'grapesjs-table-component': { /* options */ }
}
});
</script>Modern javascript
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-table-component';
import 'grapesjs/dist/css/grapes.min.css';
const editor = grapesjs.init({
container : '#gjs',
// ...
plugins: [plugin],
pluginsOpts: {
[plugin]: { /* options */ }
}
// or
plugins: [
editor => plugin(editor, { /* options */ }),
],
});Development
Clone the repository
$ git clone https://github.com/Ju99ernaut/grapesjs-table-component.git
$ cd grapesjs-table-componentInstall dependencies
$ npm iStart the dev server
$ npm startBuild the source
$ npm run buildLicense
MIT
