1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>Inline Editing by Code — CKEditor Sample</title> |
---|
5 | <meta charset="utf-8"> |
---|
6 | <script src="../ckeditor.js"></script> |
---|
7 | <link href="sample.css" rel="stylesheet"> |
---|
8 | <style> |
---|
9 | |
---|
10 | #editable |
---|
11 | { |
---|
12 | padding: 10px; |
---|
13 | float: left; |
---|
14 | } |
---|
15 | #outer { border-collapse: collapsed; border: solid 1px #000; } |
---|
16 | #outer td.border { border: solid 1px #000; } |
---|
17 | </style> |
---|
18 | </head> |
---|
19 | <body> |
---|
20 | <table id="outer"> |
---|
21 | <tr> |
---|
22 | <td class="border" style="width:100px;"></td><td class="border" style="width:800px;"> |
---|
23 | <div id="editable" contenteditable="true"> |
---|
24 | <table> |
---|
25 | <tr> |
---|
26 | <th>header one</th> |
---|
27 | <th>header two</th> |
---|
28 | </tr> |
---|
29 | <tr> |
---|
30 | <td>cell one</td> |
---|
31 | <td>cell two</td> |
---|
32 | </tr> |
---|
33 | </table> |
---|
34 | </div> |
---|
35 | </td><td class="border" style="width:100px;"></td> |
---|
36 | </tr> |
---|
37 | </table> |
---|
38 | <script> |
---|
39 | // We need to turn off the automatic editor creation first. |
---|
40 | CKEDITOR.disableAutoInline = true; |
---|
41 | |
---|
42 | var editor = CKEDITOR.inline( 'editable' ); |
---|
43 | |
---|
44 | </script> |
---|
45 | </body> |
---|
46 | </html> |
---|