- Create different types of hyperlinks
- Understand internal vs external links
- Build and format HTML tables
- Use semantic table elements
- Implement accessibility best practices
BMC201 - Web Technology
2026-02-03
Lecture 6
HTML Hyperlinks & Tables
Week 2 | Unit I: HTML Forms & CSS Introduction
BMC201 - Web Technology
Mr. Prashant Kumar Nag, Assistant Professor
Learning Objectives
The Anchor Element <a>
Hyperlinks connect web pages and resources:
Key attributes: - href: URL to navigate to - title: Tooltip text - target: Where to open (_blank for new tab) - rel: Relationship to target
The text between <a> and </a> is what users see
Four Types of Links
External Links (Absolute URLs)
Link to other websites with full URLs:
<a href="https://www.example.com">Visit Example</a>
<a href="https://github.com" target="_blank">GitHub (New Tab)</a>Key points: - Must start with https:// or http:// - Use target="_blank" to open in new tab - Consider using rel="noopener noreferrer" for security
Internal Links (Relative URLs)
Link to pages within the same website:
<a href="about.html">About Page</a>
<a href="pages/contact.html">Contact</a>
<a href="../index.html">Home</a>https://)Anchor Links (Jump within Page)
Link to specific sections on page:
<!-- At the top, create navigation -->
<nav>
<a href="#services">Services</a>
<a href="#team">Team</a>
<a href="#contact">Contact</a>
</nav>
<!-- Later on page, create sections -->
<h2 id="services">Our Services</h2>
<h2 id="team">Our Team</h2>
<h2 id="contact">Contact Us</h2>Clicking “Services” jumps directly to that section
Email Links
Allow users to send emails directly:
Advanced email link with subject:
With subject and body:
Creating Tables
Tables organize data in rows and columns:
Elements: - <table>: Container - <tr>: Table row - <td>: Table data cell - <th>: Table header cell
Complete Table Structure
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alice</td>
<td>25</td>
<td>New York</td>
</tr>
</tbody>
</table><thead>: Header rows<tbody>: Data rows<tfoot>: Footer rows (optional)Table Example: Student Grades
Table Best Practices
<thead>, <tbody>, <tfoot><th> for headers, not <td><caption> above tablescope="col"border attribute, use CSSBuilding Navigation with Links
Resources & References
Questions?
Next: Lecture 7 - HTML Forms & Form Elements