Certainly! Below is a simple HTML file that creates a webpage with a form containing all the elements you requested. The form is structured in a tabular format:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
padding: 20px;
}
table {
width: 100%;
max-width: 600px;
margin: 0 auto;
border-collapse: collapse;
}
td {
padding: 10px;
border: 1px solid #ccc;
}
input[type="text"], input[type="date"], input[type="tel"], select, textarea {
width: 100%;
padding: 8px;
box-sizing: border-box;
}
input[type="submit"], input[type="reset"] {
width: 100px;
padding: 10px;
margin-top: 10px;
cursor: pointer;
}
</style>
</head>
<body>
<h2>Registration Form</h2>
<form>
<table>
<tr>
<td>First Name:</td>
<td><input type="text" name="first_name" required></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" name="last_name" required></td>
</tr>
<tr>
<td>Gender:</td>
<td>
<label><input type="radio" name="gender" value="Male" required> Male</label>
<label><input type="radio" name="gender" value="Female"> Female</label>
<label><input type="radio" name="gender" value="Other"> Other</label>
</td>
</tr>
<tr>
<td>Subject of Interest:</td>
<td><input type="text" name="subject_of_interest"></td>
</tr>
<tr>
<td>Language Known:</td>
<td><input type="text" name="language_known"></td>
</tr>
<tr>
<td>Date of Birth:</td>
<td><input type="date" name="dob" required></td>
</tr>
<tr>
<td>Contact No.:</td>
<td><input type="tel" name="contact_no" pattern="[0-9]{10}" required></td>
</tr>
<tr>
<td>Address:</td>
<td><textarea name="address" rows="3"></textarea></td>
</tr>
<tr>
<td>Pin Code:</td>
<td><input type="text" name="pin_code" pattern="[0-9]{5,6}" required></td>
</tr>
<tr>
<td>State:</td>
<td><input type="text" name="state"></td>
</tr>
<tr>
<td>Country:</td>
<td><input type="text" name="country" required></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</body>
</html>
Features:
- The form is presented in a tabular layout using an HTML table.
- Required fields include "First Name", "Last Name", "Gender", "Date of Birth", "Contact No.", "Pin Code", and "Country".
- The "Gender" field is presented using radio buttons.
- Validation is present for the phone number (10 digits) and pin code (5 to 6 digits).
- There are "Submit" and "Reset" buttons to handle form submissions and clearing the form respectively.
You can copy the code into a .html file and open it in any modern web browser to see the form in action.