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