Table rendering
---------------

Table elements are available as widgets as well, often you want to organize
your form elements inside a table to provide pretty looking forms.
::

    >>> import yafowil.loader
    >>> from yafowil.base import factory
    >>> factory('table', name='foo')()
    u'<table></table>'
    
    >>> factory('table', name='foo_table', props={'id': 'id', 'class': 'css'})()
    u'<table class="css" id="id"></table>'
    
    >>> factory('thead', name='foo')()
    u'<thead></thead>'
    
    >>> factory('tbody', name='foo')()
    u'<tbody></tbody>'
    
    >>> factory('tr', name='foo')()
    u'<tr></tr>'
    
    >>> factory('tr', name='foo', props={'id': 'id', 'class': 'css'})()
    u'<tr class="css" id="id"></tr>'
    
    >>> factory('th', name='foo')()
    u'<th></th>'
    
    >>> factory('th',
    ...         name='foo',
    ...         props={
    ...             'id': 'id',
    ...             'class': 'css',
    ...             'colspan': 2,
    ...             'rowspan': 2,
    ...         })()
    u'<th class="css" colspan="2" id="id" rowspan="2"></th>'
    
    >>> factory('td', name='foo')()
    u'<td></td>'
    
    >>> factory('td',
    ...         name='foo',
    ...         props={
    ...             'id': 'id',
    ...             'class': 'css',
    ...             'colspan': 2,
    ...             'rowspan': 2,
    ...         })()
    u'<td class="css" colspan="2" id="id" rowspan="2"></td>'
    
    >>> form = factory('form',
    ...                name='myform',
    ...                props={
    ...                    'action': 'myaction',
    ...                })
    >>> form['table'] = factory('table')
    >>> form['table']['row1'] = factory('tr')
    >>> form['table']['row1']['field1'] = factory('td:text', name='field1')
    >>> pxml(form())
    <form action="myaction" enctype="multipart/form-data" id="form-myform" method="post">
      <table>
        <tr>
          <td>
            <input class="text" id="input-myform-table-row1-field1" name="myform.table.row1.field1" type="text" value=""/>
          </td>
        </tr>
      </table>
    </form>
    <BLANKLINE>
    
Build same table again but set some nodes structural. This is considered in
``Widget.dottedpath``.

    >>> form = factory('form',
    ...                name='myform',
    ...                props={
    ...                    'action': 'myaction',
    ...                })
    >>> form['table'] = factory('table', props={'structural': True})
    >>> form['table']['row1'] = factory('tr', props={'structural': True})
    >>> form['table']['row1']['field1'] = factory('td:text', name='field1')
    >>> pxml(form())
    <form action="myaction" enctype="multipart/form-data" id="form-myform" method="post">
      <table>
        <tr>
          <td>
            <input class="text" id="input-myform-field1" name="myform.field1" type="text" value=""/>
          </td>
        </tr>
      </table>
    </form>
    <BLANKLINE>