1.3. Templating

The [table-editor] is templated on several levels. In the most basic use, where you rely on it to build the table rows, there is the row_template option. By default, it is:

   <td$opt->{label_cell_extra}>
     {BLABEL}{LABEL}{ELABEL}{META_STRING}
   </td>
   <td$opt->{data_cell_extra}>
     <table cellspacing=0 cellmargin=0 width="100%">
       <tr>
         <td$opt->{widget_cell_extra}>
           {WIDGET}
         </td>
         <td$opt->{help_cell_extra}>
            {TKEY}
            {HELP?}<i>{HELP}</i>{/HELP?}
            {HELP_URL?}<BR><A HREF="{HELP_URL}">help</A>{/HELP_URL?}
         </td>
       </tr>
     </table>
   </td>

The values of $opt->{*_cell_extra} are constructed from the *_cell_class,

  [table-editor
            table=products
            key=os28004
            label_cell_class=myclass
            label_cell_width=10%
            label_cell_valign=top
            label_cell_extra=|bgcolor="cyan"|
            ][/table-editor]

The values specified with {LABEL}, {WIDGET}, etc. are what are used to substitute the widget values constructed from the metadata. A perfectly functional template would be:

<td>{LABEL}</td><td>{WIDGET}</td>

That would show the label and widget without any help being shown (even if it is available) and using the default styles for at table data cell.

There is also the overall template, which is passed as the container text for [table-editor]. Something equivalent to the default can be achieved with:

{TOP_OF_FORM} {HIDDEN_FIELDS} <table> <tr> <td>&nbsp;</td> <td>{TOP_BUTTONS}</td> </tr> {:REST} <tr> <td>&nbsp;</td> <td>{BOTTOM_BUTTONS}</td> </tr> </table> {BOTTOM_OF_FORM}

There are two other templates -- the break_template and the combo_template. See "Templates".