tableresize.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.md or http://ckeditor.com/license
  5. -->
  6. <html>
  7. <head>
  8. <meta charset="utf-8">
  9. <title>Using TableResize Plugin &mdash; CKEditor Sample</title>
  10. <script src="../../../ckeditor.js"></script>
  11. <link rel="stylesheet" href="../../../samples/old/sample.css">
  12. <meta name="ckeditor-sample-name" content="TableResize plugin">
  13. <meta name="ckeditor-sample-group" content="Plugins">
  14. <meta name="ckeditor-sample-description" content="Using the TableResize plugin to enable table column resizing.">
  15. </head>
  16. <body>
  17. <h1 class="samples">
  18. <a href="../../../samples/old/index.html">CKEditor Samples</a> &raquo; Using the TableResize Plugin
  19. </h1>
  20. <div class="warning deprecated">
  21. This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/table.html">brand new version in CKEditor SDK</a>.
  22. </div>
  23. <div class="description">
  24. <p>
  25. This sample shows how to configure CKEditor instances to use the
  26. <strong>TableResize</strong> (<code>tableresize</code>) plugin that allows
  27. the user to edit table columns by using the mouse.
  28. </p>
  29. <p>
  30. The TableResize plugin makes it possible to modify table column width. Hover
  31. your mouse over the column border to see the cursor change to indicate that
  32. the column can be resized. Click and drag your mouse to set the desired width.
  33. </p>
  34. <p>
  35. By default the plugin is turned off. To add a CKEditor instance using the
  36. TableResize plugin, insert the following JavaScript call into your code:
  37. </p>
  38. <pre class="samples">
  39. CKEDITOR.replace( '<em>textarea_id</em>', {
  40. <strong>extraPlugins: 'tableresize'</strong>
  41. });</pre>
  42. <p>
  43. Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
  44. the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
  45. </p>
  46. </div>
  47. <form action="../../../samples/sample_posteddata.php" method="post">
  48. <p>
  49. <label for="editor1">
  50. CKEditor using the <code>tableresize</code> plugin:
  51. </label>
  52. <textarea cols="80" id="editor1" name="editor1" rows="10">
  53. &lt;table style="width: 500px;" border="1"&gt;
  54. &lt;caption&gt;
  55. A sample table&lt;/caption&gt;
  56. &lt;tbody&gt;
  57. &lt;tr&gt;
  58. &lt;td&gt;
  59. Column 1&lt;/td&gt;
  60. &lt;td&gt;
  61. Column 2&lt;/td&gt;
  62. &lt;/tr&gt;
  63. &lt;tr&gt;
  64. &lt;td&gt;
  65. You can resize a table column.&lt;/td&gt;
  66. &lt;td&gt;
  67. Hover your mouse over its border.&lt;/td&gt;
  68. &lt;/tr&gt;
  69. &lt;tr&gt;
  70. &lt;td&gt;
  71. Watch the cursor change.&lt;/td&gt;
  72. &lt;td&gt;
  73. Now click and drag to resize.&lt;/td&gt;
  74. &lt;/tr&gt;
  75. &lt;/tbody&gt;
  76. &lt;/table&gt;
  77. </textarea>
  78. <script>
  79. // This call can be placed at any point after the
  80. // <textarea>, or inside a <head><script> in a
  81. // window.onload event handler.
  82. // Replace the <textarea id="editor"> with an CKEditor
  83. // instance, using default configurations.
  84. CKEDITOR.replace( 'editor1', {
  85. extraPlugins: 'tableresize'
  86. });
  87. </script>
  88. </p>
  89. <p>
  90. <input type="submit" value="Submit">
  91. </p>
  92. </form>
  93. <div id="footer">
  94. <hr>
  95. <p>
  96. CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
  97. </p>
  98. <p id="copy">
  99. Copyright &copy; 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
  100. Knabben. All rights reserved.
  101. </p>
  102. </div>
  103. </body>
  104. </html>