Daniele Testoni
Daniele Testoni

Reputation: 48

TinyMCE 4 Table resize cells by dragging

I was looking for a TinyMCE plugin for table resize cell by dragging and I came to: http://sourceforge.net/p/tinymce/plugins/163/?page=2

Here there is a working example http://tinymcesupport.com/premium-plugins/resize-table-cells

Unfortunately this is for an old version (I'm using the 4) and also following the migration guide I didn't came to a working version.

I'm not a Java programmer and I don't know if the migration is quite simple with some small changes or more development is necessary.

Thanks

Upvotes: 3

Views: 2309

Answers (1)

claviska
claviska

Reputation: 12480

TinyMCE now supports resizing columns with its 4.3 release. Simply enable the table plugin as shown:

tinymce.init({
  inline: true,
  selector: 'table',
  plugins: 'table'
});
table {
  border-collapse: collapse;
  
}

th, td {
  border: solid 1px #ccc;
  text-align: center;
  padding: 10px;
}
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>

Make sure the <code>table</code> plugin is activated, then drag the columns to resize them:

<table style="width: 100%;">
  <thead>
    <tr>
      <th>Column 1</th>
      <th>Column 2</th>
      <th>Column 3</th>
    </tr>
  </thead>
  <tbody>
      <tr>
      <td>Data</td>
      <td>Data</td>
      <td>Data</td>
    </tr>
  </tbody>
</table>

Upvotes: 3

Related Questions