E31: CS597 Exercise 3 – Tables and Forms
Building HTML Tables
In this part of the exercise, you’ll build a table that will hold my Fall course and office hour schedule as depicted in the image . You must use the <thead>, <tbody>, and <tfoot> elements for the appropriate parts of the table. Note also, that you will have row and column headings in the table. Finally, note where there are entries that span rows and that span columns. My version uses the following <table> attributes to have the borders shown in the image:
The first attribute sets the borders to show up and the second squashes the table cells together to have only single line borders.
To complete this exercise do the following:
- Download the DPittsCourseOFSchedule.html downloadfile and save it in your CS597 Exercises folder.
- Add your name to the meta author tag
- Add “Dave Pitts Fall Schedule” to the title tag
- Add “Dave Pitts Fall Schedule” to the heading tag
- Create the table shown in the image DPittsCourseOFSchedule.png in the HTML file, using the comments to guide where to place the information.
- Save DPittsCourseOFSchedule.html
After checking that everything looks right in the HTML file, double-check the results in a browser.
Building an HTML Form
In this exercise you are to HTML a form that displays a product request page as shown in the image. The form has four fieldsets. I use <br /> tags to break lines in the fieldsets. I use <h2> elements in the Selections fieldset for the radiobutton and checkbox rows. The input control for the quantities are number <input> controls with a minimum of 1 and a maximum of 20. The The control to select shipping is a <select> element, which uses <option> tags to give the options to choose.
To complete this exercise, do the following:
- Download the FormPart.html download template and save it in your CS597 Exercises folder.
- Edit the meta author tag to contain your name
- Edit the title tag to contain “Product Request Form”.
- Edit the top level heading to contain “Product Request Form”.
- Create a Form with the <form></form> tag pair, and include the information specified in the HTML file.
- Create the fieldset with a legend (“Identifying Information”) that requests the customers first and last name, email address, and address. Use text type <input> elements. Specify an id and name attribute for the <input> elements. Use a <label> element to identify the inputs.
- Create the fieldset with legend (“Selections”) that requests the customer choices. The titles should be <h2> heading elements. The color selection is a radiobutton group. Only one of the buttons may be selected. The product selection is a row of checkboxes. Each button’s identifying text should be a <label> element refering to the button id attribute. Each button should also have a name attribute as well as a value attribute. The value of the button value attributes should be the identifying text (for example “Red” or “Sweater”). The quantity inputs are number type <input> elements with minimum values of 1 and maximum values of 20.
- Create the fieldset with legend (“Shipping Selection”) that requests how the customer wants their products shipped. Use a <select> element with three <option> elements: One Day Shipping; Two Day Shipping; and Regular Business Shipping. The <<,,select> element must have a name attribute.
- Create the fieldset with legend (“Submit your order”) that will allow the customer to submit their order. The <textarea> should have a name attribute and specify eight rows and 50 columns. Use the submit type <input> element.
- Save the FormPart.html
After checking that everything looks right in the HTML file, double-check the results in a browser. When you are satisfied that everything is correct, submit the two HTML files in a zip archive. The HTML files must be at the top level of the zip archive.