0% found this document useful (0 votes)
22 views8 pages

HTML For Mba Grad Pune

The document provides various HTML code examples demonstrating how to add images, create tables, ordered lists, and forms. It includes examples of images as links, tables with borders, and forms with options. Additionally, it combines images, tables, and forms in a single HTML structure for a basic web page layout.

Uploaded by

Abhinav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views8 pages

HTML For Mba Grad Pune

The document provides various HTML code examples demonstrating how to add images, create tables, ordered lists, and forms. It includes examples of images as links, tables with borders, and forms with options. Additionally, it combines images, tables, and forms in a single HTML structure for a basic web page layout.

Uploaded by

Abhinav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

1.

Code for adding images


<html>
<head> <title>Image Example</title> </head>
<body>
<h1>Local Image</h1>
<img src="example.jpg" alt="Example Image" width="300" height="200">
</body>
</html>

2. Code for adding table


<html>
<head> <title>HTML Table Example</title> </head>
<body> <h1>HTML Table Example</h1>
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>25</td>
<td>New York</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>30</td>
<td>Los Angeles</td>
</tr>
<tr>
<td>Michael Brown</td>
<td>35</td>
<td>Chicago</td>
</tr>
</tbody>
</table>
</body>
</html>

3. Code for ordered list


<html>
<head> <title>Ordered List</title> </head>
<body>
<h1>Steps to Make Coffee:</h1>
<ol>
<li>Boil water</li>
<li>Add coffee</li>
<li>Pour water into cup</li>
<li>Stir and enjoy</li>
</ol>
</body>
</html>
4. Creating forms
<html>
<head> <title>Form Example</title> </head>
<body>
<h1>Contact Us</h1>
<form action="/submit" method="post">
<label for="name">Name:</label>
<br>
<input type="text" id="name" name="name">
<br>
<br> <label for="email">Email:</label>
<br> <input type="email" id="email" name="email">
<br>
<br> <input type="submit" value="Submit">
</form>
</body>
</html>

5. Image as a link
<html>
<body>
<h2>Image as a Link</h2>
<p>The image below is a link. Try to click on it.</p>
<a href="default.asp">
<img src="smiley.gif" width=”42”; height:”42"></a>
</body>
</html>

6. Table with a border


<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<h2>Table With Border</h2>
<p>Use the CSS border property to add a border to the table.</p>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>

7. Horizontal and vertical table


<html>
<head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2>Horizontal Headings:</h2>
<table style="width:100%">
<tr>
<th>Name</th>
<th>Telephone</th>
<th>Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>555 77 854</td>
<td>555 77 855</td>
</tr>
</table>
<h2>Vertical Headings:</h2>
<table style="width:100%">
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th>Telephone:</th>
<td>555 77 854</td>
</tr>
<tr>
<th>Telephone:</th>
<td>555 77 855</td>
</tr>
</table>
</body>
</html>

8. Form with options


<html lang="en">
<head> <title>Student Registration Form</title> </head>
<body>
<h2>BBA Student Registration</h2>
<form> Name: <input type="text" name="name">
<br>
<br> Email: <input type="email" name="email">
<br>
<br> Course: <select name="course">
<option value="bba">BBA</option>
<option value="mba">MBA</option>
</select>
<br>
<br>
<input type="submit" value="Register">
</form>
</body>
</html>

9. Image, table and form


<html >
<head>
<title>Basic HTML Example</title>
<style>
table {
width: 50%;
border-collapse: collapse;
margin-top: 20px;
}
th, td {
border: 1px solid black;
padding: 8px;
text-align: center;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<h1>Welcome to BBA Web Page</h1>

<h2>Image Example</h2>
<img src="https://via.placeholder.com/300" alt="Sample Image" width="300">

<h2>Table Example</h2>
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>Course</th>
</tr>
<tr>
<td>John Doe</td>
<td>22</td>
<td>BBA</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>21</td>
<td>BBA</td>
</tr>
</table>

<h2>Form Example</h2>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br><br>

<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br><br>

<label for="course">Select Course:</label>


<select id="course" name="course">
<option value="bba">BBA</option>
<option value="mba">MBA</option>
</select><br><br>

<input type="submit" value="Submit">


</form>
</body>
</html>

You might also like