Giter Site home page Giter Site logo

enderlinp / summernote-table-headers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tylerecouture/summernote-table-headers

0.0 1.0 0.0 8 KB

A Summernote plugin that adds a button to the table popover allowing the user to toggle the first row as a table header.

License: MIT License

HTML 35.14% JavaScript 64.86%

summernote-table-headers's Introduction

summernote-table-headers

A Summernote plugin that adds a button to the table popover allowing the user to toggle the first row as a table header.

How it works

The plugin creates a <thead> element at the top of the table, and moves the top <tr> into the header. It then swaps each of the <td> cells for <th> header cells. Toggle the header off reversese this.

When the summernote table popover is used to create a new column, summernote creates <td> cells within the header. The pluging detects these changes to the table and converts them to propper <th> header cells.

Usage

  1. Include summernote-table-headers.js
  2. Customize the Summernote table popover to include tableHeader
$(document).ready(function() {
  $('#summernote').summernote({
    popover: {
      table: [
        ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],
        ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],
        ['custom', ['tableHeader']]
      ],
    },
  });
});

Working Example

https://rawgit.com/tylerecouture/summernote-table-headers/master/Example/example.html

To do

  • Add vertical headers

summernote-table-headers's People

Contributors

tylerecouture avatar

Watchers

ENDERLIN P. avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.