1 <a name="VarEDITTABLE"></a>
3 ### <a name="EDITTABLE{ <em>attributes</em> } -- edi"></a> EDITTABLE\{ _attributes_ \} -- edit TWiki tables using edit fields and other input fields
5 - The `%EDITTABLE{}%` variable is handled by the [[EditTablePlugin]]
6 - Syntax: <code>%EDITTABLE\{ _attributes_ \}%</code>
8 - Supported attributes: <table border="1" cellpadding="0" cellspacing="0">
10 <th bgcolor="#99CCCC"><strong> Attribute </strong></th>
11 <th bgcolor="#99CCCC"><strong> Comment </strong></th>
12 <th bgcolor="#99CCCC"><strong> Default </strong></th>
15 <td><code>header</code></td>
16 <td> Specify the header format of a new table like <code>"%VBAR%*Food*%VBAR%*Drink*%VBAR%"</code>. Useful to start a table with only a button </td>
17 <td> (no header) </td>
20 <td><code>format</code></td>
21 <td> The format of one column when editing the table. A cell can be a text input field, or any of these edit field types:%BR% %BB% Text input field (1 line):%BR% <code>%VBAR% text, <size>, <initial value> %VBAR%</code> %BR% %BB% Textarea input field:%BR% <code>%VBAR% textarea, <rows>x<columns>, <initial value> %VBAR%</code> %BR% %BB% Drop down box: %BR% <code>%VBAR% select, <size>, <option 1>, <option 2>, etc* %VBAR%</code> %BR% <code>*</code> only one item can be selected %BR% %BB% Radio buttons: %BR% <code>%VBAR% radio, <size*>, <option 1>, <option 2>, etc %VBAR%</code> %BR% <code>*</code> size indicates the number of buttons per line in edit mode %BR% %BB% Checkboxes: %BR% <code>%VBAR% checkbox, <size*>, <option 1>, <option 2>, etc %VBAR%</code> %BR% <code>*</code> size indicates the number of checkboxes per line in edit mode %BR% %BB% Fixed label: %BR% <code>%VBAR% label, 0, <label text> %VBAR%</code> %BR% %BB% Row number: %BR% <code>%VBAR% row, <offset> %VBAR%</code> %BR% %BB% Date: %BR% <code>%VBAR% date, <size>, <initial value>, <DHTML date format> %VBAR%</code> (see [[Main/WebHome#DateField]]) </td>
22 <td><code>"text, 16"</code> %BR% for all cells </td>
25 <td><code>changerows</code></td>
26 <td> Rows can be added and removed if <code>"on"</code><br /> Rows can be added but not removed if <code>"add"</code><br /> Rows cannot be added or removed if <code>"off"</code></td>
27 <td><code>CHANGEROWS</code> %BR% plugin setting </td>
30 <td><code>quietsave</code></td>
31 <td> Quiet Save button is shown if <code>"on"</code>, hidden if <code>"off"</code></td>
32 <td><code>QUIETSAVE</code> %BR% plugin setting </td>
35 <td><code>include</code></td>
36 <td> Other topic defining the EDITTABLE parameters. The first %EDITTABLE% in the topic is used. This is useful if you have many topics with the same table format and you want to update the format in one place. </td>
40 <td><code>helptopic</code></td>
41 <td> Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. </td>
42 <td> (no help text) </td>
45 <td><code>headerislabel</code></td>
46 <td> Table header cells are read-only (labels) if <code>"on"</code>; header cells can be edited if <code>"off"</code> or "0" </td>
47 <td><code>"on"</code></td>
50 <td><code>editbutton</code></td>
51 <td> Set edit button text, e.g. <code>"Edit this table"</code>; set button image with alt text, e.g. <code>"Edit table, %PUBURL%/%TWIKIWEB%/TWikiDocGraphics/edittopic.gif"</code>; hide edit button at the end of the table with <code>"hide"</code> (Note: Button is automatically hidden if an edit button is present in a cell) </td>
52 <td><code>EDITBUTTON</code> %BR% plugin setting </td>
55 <td><code>javascriptinterface</code></td>
56 <td> Use javascript to directly move and delete row without page refresh. Enable with <code>"on"</code>, disable with <code>"off"</code>. </td>
57 <td><code>JAVASCRIPTINTERFACE</code> %BR% plugin setting </td>
61 - Example:%BR% `%EDITTABLE{ format="| text, 20 | select, 1, one, two, three |" changerows="on" }%` %BR% `| *Name* | *Type* |` %BR% `| Foo | two |`
62 - Related: See [[EditTablePlugin]] for more details