[Typo3] TemplaVoila: Creating a template for tables
David Rosenkranz
david.rosenkranz at detewe.ch
Wed Nov 2 11:34:18 CET 2005
Hi there,
I just figured out a solution myself. Perhaps anyone's interested in it,
too.
The key is that I need an html element which would surround all the
datalines so it can be used as a TV-section. So here is my template HTML:
<table id="containertable">
<tr id="headline">
<td id="headcell1">Col1</td>
<td id="headcell2">Col2</td>
</tr>
<span id="datalines">
<tr id="dataline">
<td id="datacell1">Col1</td>
<td id="datacell2">Col2</td>
</tr>
</span>
</table>
As you can see, there is a span#datalines which now surrounds the dataline
tablerows. This is not correct html but it allows me to do the following
mapping and it will not be rendered this bad way.
TV mapping:
Root, container, mapped to table#containertable, outer
Headline, container, mapped to tr#headline, inner
Head cell 1, element, mapped to td#headcell1, inner
Head cell 2, element, mapped to td#headcell2, inner
Datalines, section, mapped to span#datalines, outer
Dataline, container, mapped to tr#dataline, outer
Cell 1, element, mapped to td#datacell1, inner
Cell 2, element, mapped to td#datacell2, inner
This produces the following rendered html:
<table id="containertable">
<tr id="headline">
<td id="headcell1">Col 1</td>
<td id="headcell2">Col 2</td>
</tr>
<tr id="dataline">
<td id="datacell1">Cell 1</td>
<td id="datacell2">Cell 2</td>
</tr><tr id="dataline">
<td id="datacell1">Cell 3</td>
<td id="datacell2">Cell 4</td>
</tr>
</table>
...just the way I like it.
Thanks to you all for the inspiration.
Regards
David
> -----Ursprüngliche Nachricht-----
> Von: typo3-english-bounces at lists.netfielders.de
> [mailto:typo3-english-bounces at lists.netfielders.de] Im
> Auftrag von David Rosenkranz
> Gesendet: Mittwoch, 2. November 2005 10:53
> An: 'TYPO3 English'
> Betreff: Re: [Typo3] TemplaVoila: Creating a template for tables
>
>
> Hi Dimitry,
>
> Thanks a lot, but this does not work either.
> 1. I cannot map the dataline section to tr#dataline (inner)
> and then map
> dataline container to the same html-element (outer).
> tr#dataline just is not
> available for mapping after I did the section mapping. Therefor I just
> swapped inner/outer, so the section is now mapped to outer
> and the container
> is mapped to inner. At least the mapping process works this
> way. But...
>
> 2. ... The rendering still isn't perfect yet. The <tr> tags
> of the datalines
> are still missing, which might be caused by my
> inner/outer-swapping. But I
> could not do it without it.
> ...
> <table id="containertable">
> <tr id="headline">
> <td id="headcell1">First Column</td>
> <td id="headcell2">Second Column</td>
> </tr>
>
> <td id="datacell1">Here goes my data1</td>
> <td id="datacell2">Here goes my data2.</td>
>
> <td id="datacell1">Here goes my data3. </td>
> <td id="datacell2">Here goes my data4. </td>
>
> </table>
> ...
>
> Do you or anyone else have another hint? Thanks a lot!
>
> Regards
>
> David
> Bern, Switzerland
>
> >
> > Root Element (Container, mapped to div#root, inner)
> > Table (Container, mapped to table#containertable, inner)
> > Headline (Container, mapped to tr#headline, inner)
> > Headline cell 1 (Element, mapped to td#headcell1, inner)
> > Headline cell 2 (Element, mapped to td#headcell2, inner)
> > Dataline (Section, mapped to tr#dataine, inner)
> > Dataline section (Container, mapped to tr#dataline, outer)
> > Dataline cell 1 (Element, mapped to td#datacell1, inner)
> > Dataline cell 2 (Element, mapped to td#datacell2, inner)
> >
> > Table itself is not repeatable, so it is not a section.
> Headline is a
> > single object, si it is just a container (you could get rid
> of it too
> > but it is just convinient to have it). Data line is repeatable so it
> > must have a section and a container in it. Notice also the order of
> > inner/outer mappings, this is important.
> >
> > Dmitry.
> > _______________________________________________
> > Typo3-english mailing list
> > Typo3-english at lists.netfielders.de
> > http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
> >
>
>
> _______________________________________________
> Typo3-english mailing list
> Typo3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
More information about the TYPO3-english
mailing list