I have a Python Function createForm(CakeName,Inches) for creating a FORM with two sets List/Menus. This Form function contains two further embedded functions - createDropDown(Inches) and createDropDown(CakeName) for creating the List/Menus.
The number of List/Menus in each set is determined by the customer. If he orders 7 cakes, then he will be presented with seven identical List/Menus allowing him to choose which cake type/name is required. He will also be presented with a further seven identical List/Menus which will allow for choosing the cake size. Clearly these two sets of List/Menu's need to be aligned horizontally. This is the problem.
Layout_No_Table.jpg attached shows the layout as it now is - these are not aligned horizontally. The CreateForm(CakeName, Inches) is shown below. My problem is how to modify this function to get proper alignment.
..................................................................................................................................................................................................
def createForm(CakeName,Inches):
print("""<form method="post" action="orderformAction.cgi">""")
for i in range(n):
createDropDown(CakeName)
createDropDown(Inches)
Layout-with-table.jpg attached shows the result when I try and use html tables within the python function code to achieve the layout. You will see the at the layout problem is solved, but the embedded functionsCreateDropDown(CakeName) and CreateDropDown(inches) are not triggered. The form function with the embedded table is shown below
.......................................................................................................................................................................................
def createForm(CakeName,Inches):
print("""<form method="post" action="orderformAction.cgi">""")
print("<table width='511' border='1' cellspacing='0' cellpadding='0'>")
print("<caption>")
print("CAKE SHOP")
print("</caption>")
#print("<tr>")
#print("<th colspan='2' scope='col'>Choose Cake Types and Sizes</th>")
#print("</tr>")
print("<tr>")
print("<td colspan='2'> </td>")
print("</tr>")
for i in range(n):
print("<tr>")
print("<td colspan='2'>createDropDown(Inches)</td>")
print("<td colspan='2'>createDropDown(CakeName)</td>")
In summary, I need to know how to align the form elements as needed. It seems that its not possible to embed html tables into the form function to achieve this alignment. Any ideas fixes appreciated !!
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.