Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WYSIWYG - Easier header rows #985

Closed
ssddanbrown opened this issue Aug 23, 2018 · 4 comments
Closed

WYSIWYG - Easier header rows #985

ssddanbrown opened this issue Aug 23, 2018 · 4 comments

Comments

@ssddanbrown
Copy link
Member

At the moment, to set a header on a table you have to click into the row > Click the table options in the top toolbar > Row > Row Properties > Change row type to header.

We should look to either make the first row, if more than one row, be a header or make it easier to set a header row.

Might be limited on TinyMCE control, Possibly hook into such an event like this:
https://github.com/tinymce/tinymce/blob/master/src/plugins/table/main/ts/api/Events.ts#L14

Might be tricky.

@alfonsrv
Copy link

Confluence solved this by having the first row be a header by default and then adding a dedicated menu row for then a table is currently selected.

@Roemer
Copy link

Roemer commented Jan 22, 2024

I added a "hack" that adds a button for toggling row/column headers in the context menu of the table and at the end of the main toolbar (couldn't figure out a way to add it to the table menu of the main toolbar yet).
The hack is here: BookStackApp/hacks#7

Edit: As an alternative, a second row similar to Confluence can be added. This would look like this:
image
and is done with this customization:

<script>
  window.addEventListener('editor-tinymce::pre-init', event => {
    const mceConfig = event.detail.config;
    mceConfig.toolbar = [
      mceConfig.toolbar,
      'table | tableinsertrowbefore tableinsertrowafter tabledeleterow | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter | tableinsertcolbefore tableinsertcolafter tabledeletecol | tablemergecells tablesplitcells | tablerowheader tablecolheader | tablecellbackgroundcolor | tabledelete'
    ];
      
    mceConfig.table_toolbar = 'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol | tablerowheader tablecolheader';
  });
</script>

@ssddanbrown
Copy link
Member Author

Thanks for the input and sharing of hack/workaround @Roemer, this promoted me to put in a solution for the next release.
Within 8f1d8ce the header row toggle is dynamically shown as part of the existing table toolbar, when within the first row. Unlike your hack I havn't added the column header toggle, as I've not really seen much demand for header columns.

@platnub
Copy link

platnub commented Mar 25, 2024

Thanks for the input and sharing of hack/workaround @Roemer, this promoted me to put in a solution for the next release. Within 8f1d8ce the header row toggle is dynamically shown as part of the existing table toolbar, when within the first row. Unlike your hack I havn't added the column header toggle, as I've not really seen much demand for header columns.

Hello, column headers would be nice. Seems to me this would just be feature parity. Why have the feature for rows, but not columns? Even if there isn't much demand yet. It's the exact same thing just on a different axis.

If the feature is already written, and exists, why not implement it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants