tableresize.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <!--
  3. Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.html or http://ckeditor.com/license
  5. -->
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <title>Using TableResize Plugin &mdash; CKEditor Sample</title>
  9. <meta content="text/html; charset=utf-8" http-equiv="content-type" />
  10. <script type="text/javascript" src="../ckeditor.js"></script>
  11. <script src="sample.js" type="text/javascript"></script>
  12. <link href="sample.css" rel="stylesheet" type="text/css" />
  13. </head>
  14. <body>
  15. <h1 class="samples">
  16. CKEditor Sample &mdash; Using the TableResize Plugin
  17. </h1>
  18. <div class="description">
  19. <p>
  20. This sample shows how to configure CKEditor instances to use the
  21. <strong>TableResize</strong> (<code>tableresize</code>) plugin that allows
  22. the user to edit table columns by using the mouse.
  23. </p>
  24. <p>
  25. The TableResize plugin makes it possible to modify table column width. Hover
  26. your mouse over the column border to see the cursor change to indicate that
  27. the column can be resized. Click and drag your mouse to set the desired width.
  28. </p>
  29. <p>
  30. By default the plugin is turned off. To add a CKEditor instance using the
  31. TableResize plugin, insert the following JavaScript call into your code:
  32. </p>
  33. <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>',
  34. {
  35. <strong>extraPlugins : 'tableresize'</strong>
  36. });</pre>
  37. <p>
  38. Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
  39. the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
  40. </p>
  41. </div>
  42. <!-- This <div> holds alert messages to be display in the sample page. -->
  43. <div id="alerts">
  44. <noscript>
  45. <p>
  46. <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
  47. support, like yours, you should still see the contents (HTML data) and you should
  48. be able to edit it normally, without a rich editor interface.
  49. </p>
  50. </noscript>
  51. </div>
  52. <form action="sample_posteddata.php" method="post">
  53. <p>
  54. <label for="editor1">
  55. CKEditor using the <code>tableresize</code> plugin:</label>
  56. <textarea cols="80" id="editor1" name="editor1" rows="10">
  57. &lt;table style="width: 500px;"&gt;
  58. &lt;caption&gt;
  59. A sample table&lt;/caption&gt;
  60. &lt;tbody&gt;
  61. &lt;tr&gt;
  62. &lt;td&gt;
  63. Column 1&lt;/td&gt;
  64. &lt;td&gt;
  65. Column 2&lt;/td&gt;
  66. &lt;/tr&gt;
  67. &lt;tr&gt;
  68. &lt;td&gt;
  69. You can resize a table column.&lt;/td&gt;
  70. &lt;td&gt;
  71. Hover your mouse over its border.&lt;/td&gt;
  72. &lt;/tr&gt;
  73. &lt;tr&gt;
  74. &lt;td&gt;
  75. Watch the cursor change.&lt;/td&gt;
  76. &lt;td&gt;
  77. Now click and drag to resize.&lt;/td&gt;
  78. &lt;/tr&gt;
  79. &lt;/tbody&gt;
  80. &lt;/table&gt;
  81. </textarea>
  82. <script type="text/javascript">
  83. //<![CDATA[
  84. // This call can be placed at any point after the
  85. // <textarea>, or inside a <head><script> in a
  86. // window.onload event handler.
  87. // Replace the <textarea id="editor"> with an CKEditor
  88. // instance, using default configurations.
  89. CKEDITOR.replace( 'editor1', {
  90. extraPlugins : 'tableresize'
  91. });
  92. //]]>
  93. </script>
  94. </p>
  95. <p>
  96. <input type="submit" value="Submit" />
  97. </p>
  98. </form>
  99. <div id="footer">
  100. <hr />
  101. <p>
  102. CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
  103. </p>
  104. <p id="copy">
  105. Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
  106. Knabben. All rights reserved.
  107. </p>
  108. </div>
  109. </body>
  110. </html>