How can I combine a table and a form ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chu2654
Forum Newbie
Posts: 11
Joined: Mon Aug 07, 2006 6:59 pm

How can I combine a table and a form ?

Post by chu2654 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello,
   I want to use both the tables and the HTML_QuickForm.  But how can I combine these two ?  I use the following code but both elements show in the same cell.

Code: Select all

<?php

   require_once "HTML/QuickForm.php";
   $form = new HTML_QuickForm("frmTest","post","");
   echo "<table border =1><tr><td>";
   $form->addElement('header','myheader','test');

   echo "</td></tr>";
   echo "<tr><td>";
   $form->addElement('text','mytext','test');
   $form->display();
   echo "</td></tr>";
   echo "</table>";

?>

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

HTML_QuickForms renders a table around the form by default so you shouldn't even need to change how it renders, but if you want to change it, you just need to write a renderer for it:

http://pear.php.net/manual/en/package.h ... orm.output
chu2654
Forum Newbie
Posts: 11
Joined: Mon Aug 07, 2006 6:59 pm

Why can't I install HTML_QuickForm_Renderer ?

Post by chu2654 »

When I install HTML_QuickForm_Renderer, it will show no releases availble. What should I do ?
Post Reply