function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rocio VivancoRocio Vivanco 

Is it possible to use <table> with <apex:pageblocksection>?

Hi all,

I am trying to display a table using the <table> tag and pageblocksection, but fields appear dispersed:
 
<apex:pageBlock id="newopty"  rendered="true" title="New Opportunity">
        <apex:pageBlockSection id="Lapse" columns="2" collapsible="true" title="New Opportunity">
         <html>
           <table class="list" border="0" cellspacing="0" cellpadding="0" style="width:100% !important">
              <tr class="headerRow">
                  <th><b>Name</b></th>
                  <th><b>FDF</b></th>
                  <th><b>Feedback</b></th>
              </tr>
              <tr>
                 <td style="white-space:nowrap;"><apex:inputText id="optyname" value="{!optyname}" /></td>                  
                 <td style="white-space:nowrap;"><apex:inputCheckbox id="FDFcheck" value="{!FDFcheck}"/></td>
                 <td rowspan="7" style="white-space:nowrap;"><apex:inputTextarea id="feedback" value="{!feedback}" rows="7" /></td>
              </tr>
              <tr class="headerRow">
                 <th><b>Product</b></th>
                 <th><b>API</b></th>
              </tr>
              <tr>
                 <td style="white-space:nowrap;"><apex:inputText list="{!listOfproducts}" value="{!prodfamily}" /></td>
                 <td style="white-space:nowrap;"><apex:inputCheckbox value="{!APIcheck}" id="APIcheck" /></td>
              </tr>
              <tr class="headerRow">
                 <th><b>Close Date</b></th>
                 <th><b>Close lost</b></th>
               </tr>
               <tr>
                 <td style="white-space:nowrap;"><apex:inputText value="{!datename}" size="10" id="demo" onfocus="DatePicker.pickDate(false, this , false);"/>
                 </td>
                 <td style="white-space:nowrap;"><apex:inputCheckbox value="{!closelost}" id="closelost" /></td>
               </tr>
           </table>
          </html>
              <apex:commandButton value="submit" action="{!Submit}"/>
        </apex:pageBlockSection>
</apex:pageblock>
User-added image

I don't want to use pageTable as I am not displaying a list of records.
Someone here was facing the same issue, I tried to solve as described in his thread, but without success til now.
I would appreciate any tips, is it possible to use <table> with <apex:pageblocksection>?
 
Best Answer chosen by Rocio Vivanco
Rocio VivancoRocio Vivanco
So, for the ones facing the same issue, I found out that I had to use this construction:


        <apex:pageBlockSection id="Lapse" columns="1" collapsible="true" title="New Opportunity">
          <apex:pageBlockSectionItem>
           <apex:outputPanel>
            <table>...

That worked for me.

 

All Answers

Rocio VivancoRocio Vivanco
Hi, it seems to be you haven't read my thread carefully. The issue I was pointing to is the second link. I can not mark your answer as solution. Sorry, that doesn't help me. More tips are welcome.
Rocio VivancoRocio Vivanco
So, for the ones facing the same issue, I found out that I had to use this construction:


        <apex:pageBlockSection id="Lapse" columns="1" collapsible="true" title="New Opportunity">
          <apex:pageBlockSectionItem>
           <apex:outputPanel>
            <table>...

That worked for me.

 
This was selected as the best answer