You need to sign in to do that
Don't have an account?
tengel
inputField in HTML Table? (or welcome to other suggestions!)
Hi! I would like to present my users with a custom VF page for entering/editing records. The page will have a number of tables and the cells of these tables will have a mix of hardcoded values and input options. I thought I was on the right track, but when I try to put an apex:inputField in one of the <td> tags, the HTML breaks and my table gets all messed up.
VF code:
VF code:
<table border="1" style="width:800px"> <tbody><tr> <th>EXCLUDE DBL AND BENEFITS</th> <th>SAMPLE</th> <th>YOURS</th> <th>KEY</th> </tr> <tr> <td>Gross Commission Pr1</td> <td>300000</td> <td></td><td class="dataCol first " colspan="2"><input id="j_id0:j_id2:j_id3:section1:j_id13" name="j_id0:j_id2:j_id3:section1:j_id13" size="20" style="width:100px" type="text"></td></tr><tr><td class="dataCol last " colspan="2"></td> <td>Book of Business minus DBL and Benefits</td> </tr> </tbody></table>Image of broken table:
Make sure that the api is 27.0 or later.
Wrapping the HTML Table with an <apex:outputPanel> tag or, what is probably more appropriate, <apex:pageBlockSectionItem> then <apex:outputPanel> tags fixed it for me. If you don't add the outputPanel under the pageBlockSectionItem, you'll get the error that there are more than 2 child elements.
Also, make sure the pageBlockSection has columns set to 1 if you want the table to fill the entire width of the section.