You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Joerg Jaspert <em...@german.ath.cx> on 2002/03/18 01:08:15 UTC
Add a row to a dynamic table
Hi
If i have a table like this:
<table>
<tr>
[- $r = $set[$row] -]
<td class="center"><input type="checkbox" name="kill" value="[+ $r -> {id} +]" align="top"></td>
<td class="center"><a href="[+$path+]?site=change&did=[+ $r -> {did} +]">[+ $r -> {did} +]</a></td>
<td>[+ $r -> {kundennummer} +]</td>
</tr>
</table>
How can i add a row at the bottom of the Table ? Embperl knows a Table
Header, so i can use th there. But if i want to add a row to the End it
wont work. (Ok, if i add a <tr>...</tr> it is there, but after every
row, not only after the last).
Is there a way to do this with $row, $col etc. or do i have to go the
hard way building my own foreach, while, etc. for every "dynamic" table?
Thx.
--
begin OjE-ist-scheisse.txt
bye, Joerg
Registered Linux User #97793 @ http://counter.li.org
end
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Add a row to a dynamic table
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
if you know the number of rows you can add something like
[$if $row == $numrows $]
....
[$endif$]
Since your example seems to be the output of DBIx::Recordset, I would write
it as:
> <table>
[$ while $r = $set -> Next $]
> <tr>
> <td class="center"><input type="checkbox" name="kill" value="[+ $r ->
{id} +]" align="top"></td>
> <td class="center"><a href="[+$path+]?site=change&did=[+ $r -> {did}
+]">[+ $r -> {did} +]</a></td>
> <td>[+ $r -> {kundennummer} +]</td>
> </tr>
[$endwhile$]
# Here you can insert anything at the end of the table
> </table>
>
It's not much more to write, but it is more clear to the reader what's going
on here
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Add a row to a dynamic table
Posted by Kee Hinckley <na...@somewhere.com>.
At 1:08 AM +0100 3/18/02, Joerg Jaspert wrote:
>Is there a way to do this with $row, $col etc. or do i have to go the
>hard way building my own foreach, while, etc. for every "dynamic" table?
I find that I'm seldom able to use automatic tables for that reason.
A way of "escaping" a row would be nice.
--
Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/
nazgul@somewhere.com
I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org