All Projects → soccerloway → Quill Better Table

soccerloway / Quill Better Table

Licence: mit
Module for better table in Quill, more useful features are supported.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Quill Better Table

Vue2 Editor
A text editor using Vue.js and Quill
Stars: ✭ 2,316 (+1223.43%)
Mutual labels:  quill, quilljs
quill-magic-url
Automatically convert URLs to links in Quill
Stars: ✭ 86 (-50.86%)
Mutual labels:  quill, quilljs
Ngx Quill Editor
🍡@quilljs editor component for @angular
Stars: ✭ 234 (+33.71%)
Mutual labels:  quill, quilljs
Flutter Quill
Rich text editor for Flutter
Stars: ✭ 177 (+1.14%)
Mutual labels:  quill, quilljs
Yii2 Quill
Yii 2 implementation of Quill, modern WYSIWYG editor
Stars: ✭ 52 (-70.29%)
Mutual labels:  quill, quilljs
angular quill
Angular dart component for the Quill rich text editor
Stars: ✭ 22 (-87.43%)
Mutual labels:  quill, quilljs
quilljs-rails
Easy integration of Quill rich editor with most Rails forms.
Stars: ✭ 33 (-81.14%)
Mutual labels:  quill, quilljs
quill-markdown-toolbar
A Quill.js module for converting markdown text to rich text format
Stars: ✭ 13 (-92.57%)
Mutual labels:  quill, quilljs
Vue Quill Editor
🍡@quilljs editor component for @vuejs
Stars: ✭ 6,874 (+3828%)
Mutual labels:  quill, quilljs
Quill Mention
💬 @mentions for the Quill rich text editor
Stars: ✭ 349 (+99.43%)
Mutual labels:  quill, quilljs
Ngx Quill
Angular (>=2) components for the Quill Rich Text Editor
Stars: ✭ 1,382 (+689.71%)
Mutual labels:  quill, quilljs
Quilljs Table
Table functionality for quilljs
Stars: ✭ 101 (-42.29%)
Mutual labels:  table, quilljs
Ngx Quill Example
demo app for the advanced usage of ngx-quill module
Stars: ✭ 137 (-21.71%)
Mutual labels:  quill, quilljs
Sematable
ReactJS / Redux Data Table
Stars: ✭ 155 (-11.43%)
Mutual labels:  table
Markdown Table
Markdown tables, with alignment
Stars: ✭ 164 (-6.29%)
Mutual labels:  table
Schedule
Schedule is a package that helps tracking schedules for your models. If you have workers in a company, you can set schedules for them and see their availability though the time.
Stars: ✭ 155 (-11.43%)
Mutual labels:  table
Smart Table
Code source of Smart Table module: a table/grid for Angularjs
Stars: ✭ 1,827 (+944%)
Mutual labels:  table
Json2html
🐍 Python module for converting complex JSON to HTML Table representation
Stars: ✭ 173 (-1.14%)
Mutual labels:  table
Vue Materialize Datatable
A fancy Materialize CSS datatable VueJS component.
Stars: ✭ 162 (-7.43%)
Mutual labels:  table
Vuejs Datatable
A Vue.js component for filterable and paginated tables.
Stars: ✭ 148 (-15.43%)
Mutual labels:  table

quill-better-table

A module for better table in Quill, more useful features are supported. There is a list of features below. Thanks quilljs for its awesome extensibility. Hope that quill-better-table could help you.

Online Demo

quill-better-table Codepen Demo

Updated v1.2.10

  • Replace TableCellLine.tagName from `DIV` to `P`. Using `DIV` to implement TableCellLine led a copy/paste issue: Pasting plain text also changes to table format. There are many more similar situations. When the user pastes the DIV tag into the editor, the DIV will be treated as a TableCellLine. Using `P` is more appropriate and fixes the mentioned issue. If this update caused any other new issues, tell me as soon as possible please, thanks! Best wishes.

Features

Clicking on tables in quill editor will initialize the tools for table, all features are based on it.

  • Multiple lines in table cell

    Press Enter to add new lines in the table cell now.

  • Add table column left/right

    Right-click on table to open context menu, you can see the button.

  • Add table row top/bottom

    Right-click on table to open context menu, you can see the button.

  • Remove selected table columns

    Right-click on table to open context menu, you can see the button.

  • Remove selected table rows

    Right-click on table to open context menu, you can see the button.

  • Selects multiple table cells

    Dragging over the table cells could select the tableCells surrounded by the highlight borders.

  • Merge/Unmerge table cells

    Right-click on table to open context menu, you can see the button.

  • Resize the width of column

    Dragging lines between the top tool for columns could resize width of columns.

  • Delete table

    Right-click on table to open context menu, you can see the button.

Requirements

quilljs v2.0.0-dev.3

Since I use webpack externals to bundle, you must expose Quill to window object, like load quill.js by script tag globally. Or you may need to fork this repo and build what you need.

Installation

npm install quill-better-table

Usage

Load quill and style dependencies

<script src="https://cdnjs.cloudflare.com/ajax/libs/quill/2.0.0-dev.3/quill.min.js" type="text/javascript"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/quill/2.0.0-dev.3/quill.snow.min.css" rel="stylesheet">
<link href="https://unpkg.com/[email protected]/dist/quill-better-table.css" rel="stylesheet">

ES6

import QuillBetterTable from 'quill-better-table'

Quill.register({
  'modules/better-table': QuillBetterTable
}, true)

window.onload = () => {
  const quill = new Quill('#editor-wrapper', {
    theme: 'snow',
    modules: {
      table: false,  // disable table module
      'better-table': {
        operationMenu: {
          items: {
            unmergeCells: {
              text: 'Another unmerge cells name'
            }
          }
        }
      },
      keyboard: {
        bindings: QuillBetterTable.keyboardBindings
      }
    }
  })

  document.body.querySelector('#insert-table')
    .onclick = () => {
      let tableModule = quill.getModule('better-table')
      tableModule.insertTable(3, 3)
    }
}

Module methods

first, you can get quill-better-table module by quill.getModule

let module = quill.getModule('better-table')

module.getTable(range = quill.getSelection())

get an array with TableContainer, TableRow, TableCell, offset through the given range.

module.getTable()  // current selection
module.getTable(range)
// [TableContainer, TableRow, TableCell, 0]

module.insertTable(rows: Number, columns: Number)

insert table at current position

module.insertTable(3, 3)

Module Options

quill-better-table only provide operation options now.

const quill = new Quill('#editor', {
  theme: 'snow',
  modules: {
    table: false,  // disable table module
    'better-table': {
      operationMenu: {
        items: {
          unmergeCells: {
            text: 'Another unmerge cells name'
          }
        },
        color: {
          colors: ['#fff', 'red', 'rgb(0, 0, 0)'],  // colors in operationMenu
          text: 'Background Colors'  // subtitle
        } 
      }
    },
    keyboard: {
      bindings: QuillBetterTable.keyboardBindings
    }
  }
})

operationMenu

OperationMenu configures the operation list in right-click menu.

operationMenu.items

operationMenu show all operations as default. false will remove the operation.

{
  operationKey: {
    text: 'foo'
  },

  operationKey: false
}

operationKey is the name of operation, there is a list below:

  • insertColumnRight
  • insertColumnLeft
  • insertRowUp
  • insertRowDown
  • mergeCells
  • unmergeCells
  • deleteColumn
  • deleteRow
  • deleteTable

You may need to modify the menu text, operationKey.text will do that.

operationMenu.color

Background colors is optional, the default is hidden. If you need this feature, use this configure.

{
  colors: ['#fff', 'red', 'rgb(0, 0, 0)'],  // colors you need in operationMenu, ['white', 'red', 'yellow', 'blue'] as default
  text: 'Background Colors'  // subtitle, 'Background Colors' as default
} 

Community

Send me an email([email protected]) or Contribute on Issues, I glad to hear your suggestion.

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].