1.3: TABLES, AUDIO/VIDEO MEDIA & INLINE SVG — DATA GRIDS, EMBEDS & VECTOR GRAPHICS

Structure tabular datasets with accessible HTML5 table semantics, embed native audio and video players with captions, and draw resolution-independent inline SVG graphics—with live interactive demos and copyable code.

📊 Lesson Overview: Tabular Data, Native Media & Scalable Vector Graphics

Real-world web applications frequently display structured tabular records (invoices, student grades, product inventories), play audio or video clips, and render crisp logos, icons, and progress charts. HTML5 provides dedicated native elements for each of these jobs without requiring external plugins.

  • Structure data tables cleanly with , , , , scope="col", and scope="row".
  • Embed native and players with multiple fallbacks and accessibility captions.
  • Build sharp, scalable UI icons and progress rings using inline elements controlled by CSS and JavaScript.
1. Semantic HTML5 Data Tables & Responsive Wrappers
Use HTML tables strictly for tabular data (never for overall page layout). Grouping rows into , , and and adding scope attributes on headers helps screen readers announce column and row context accurately, while an overflow-x: auto wrapper prevents horizontal page overflow on mobile screens.
Quarterly Training Batch Summary
Course Track Batch Code Enrolled Students Completion Rate
HTML5 & CSS3 Foundations FS-101 48 94%
JavaScript & DOM Engineering FS-102 45 91%
Node.js & Express APIs FS-103 42 88%
Total / Average Across Tracks 135 91%
HTML5 (accessible_data_table.html)
Quarterly Training Batch Summary
Course Track Enrolled Completion
HTML5 & CSS3 Foundations 48 94%
Total 48 Students (94%)
Result: Structured data table with , scope="col"/"row" headers, summary row, and horizontal scroll wrapper.
2. Native HTML5 Audio, Video & Caption Tracks
HTML5 embeds audio and video natively via and without third-party browser plugins:
  • controls & preload="metadata": Displays standard play/pause/seek controls while loading only duration and dimensions upfront instead of downloading huge files immediately.
  • Multiple Formats: Providing modern formats (like .webm or .mp4 / .ogg) ensures cross-browser playback compatibility.
  • Captions & Subtitles (): Attaching a WebVTT (.vtt) track with kind="captions" makes spoken video accessible to deaf/hard-of-hearing users and sound-off viewers.
  • Autoplay Guardrails: Browsers block unmuted autoplay—if background video autoplay is ever needed, pair autoplay muted loop playsinline.
HTML5 (html5_audio_video_embed.html)
Lesson 1.3 Audio Walkthrough
Result: Accessible
3. Inline SVG Graphics & Live Progress Ring Playground
Unlike raster images (.jpg, .png, .bmp) that blur when scaled up, SVG (Scalable Vector Graphics) uses XML shapes (, , , ) inside a viewBox coordinate system—staying razor-sharp at any screen DPI and allowing live styling or animation with CSS and JavaScript.

Interactive SVG Progress Ring

Course Completion Progress Ring 72%

Inline SVG Icon & Badge Anatomy

Key attributes that keep inline SVGs clean and accessible:

  • viewBox="0 0 120 120": Defines internal drawing coordinates so the SVG scales proportionally.
  • role="img" + </code>:</strong> Gives meaningful SVGs an accessible label; use <code>aria-hidden="true"</code> for purely decorative icons.</li> <li><strong><code>stroke-dasharray</code> / <code>stroke-dashoffset</code>:</strong> Animates ring charts and line paths cleanly with zero external chart libraries.</li> </ul> </div> </div> </div> <div class="code-container"> <div class="code-header"> <span class="code-label">HTML5 + SVG (inline_svg_progress_ring.html)</span> <button class="copy-btn" type="button">📋 Copy Code</button> </div> <pre><code><svg width="150" height="150" viewBox="0 0 120 120" role="img" aria-labelledby="ringTitle"> <title id="ringTitle">Course Completion Progress 72%
Result: Crisp vector progress ring rendered with and elements inside a 120x120 viewBox.
4. Practical Checkpoints for Tables, Media & SVG
Keep these habits in mind whenever you add tables, media players, or vector graphics to your pages:
  • Use tables only for structured tabular data: Include , , , and scope attributes, and wrap wide tables in a horizontal scroll container.
  • Optimize media loading and captions: Use preload="metadata", provide fallback formats, and add for spoken video.
  • Always set viewBox and proper ARIA semantics on SVGs: Mark decorative icons aria-hidden="true" and meaningful charts with role="img" and </code>.</li> </ul> </div> <div class="code-container"> <div class="code-header"> <span class="code-label">HTML5 (tables_media_svg_checklist.txt)</span> <button class="copy-btn" type="button">📋 Copy Code</button> </div> <pre><code>[x] Data tables include <caption>, <thead>, <tbody>, and th scope attributes [x] Wide tables are wrapped in an overflow-x: auto container for mobile screens [x] Audio/Video tags include controls, fallback <source> elements, and captions [x] Inline SVGs define a viewBox and proper accessibility attributes</code></pre> </div> <div class="output">Result: Checklist ready for reviewing HTML5 tables, media players, and inline SVG components.</div> </div> </section> <!-- FOOTER --> <footer class="footer"> <p>© 2026 Nikita-Infotech | Full Stack Web Development Course — HTML5, CSS3, JavaScript & Node.js</p> </footer> </main> </div> <script> // Interactive SVG Progress Ring controller const slider = document.getElementById('svgProgressSlider'); const pctLabel = document.getElementById('svgPctLabel'); const progressCircle = document.getElementById('svgProgressCircle'); const centerText = document.getElementById('svgCenterText'); const toggleColorBtn = document.getElementById('svgToggleColorBtn'); const CIRCUMFERENCE = 2 * Math.PI * 48; // ~301.59 const ACCENT_COLORS = ['#0ea5e9', '#16834d', '#6c2bd9', '#c86d18']; let colorIndex = 0; function updateSvgRing(pct) { const clamped = Math.max(0, Math.min(100, Number(pct))); const offset = CIRCUMFERENCE * (1 - clamped / 100); progressCircle.setAttribute('stroke-dashoffset', offset.toFixed(2)); centerText.textContent = `${clamped}%`; pctLabel.textContent = `${clamped}%`; } slider.addEventListener('input', () => updateSvgRing(slider.value)); toggleColorBtn.addEventListener('click', () => { colorIndex = (colorIndex + 1) % ACCENT_COLORS.length; progressCircle.setAttribute('stroke', ACCENT_COLORS[colorIndex]); }); updateSvgRing(slider.value); // Copy code snippet functionality document.querySelectorAll('.copy-btn').forEach(button => { button.addEventListener('click', () => { const codeContainer = button.closest('.code-container'); const codeText = codeContainer.querySelector('pre').innerText; navigator.clipboard.writeText(codeText).then(() => { button.textContent = '✓ Copied!'; button.classList.add('copied'); setTimeout(() => { button.textContent = '📋 Copy Code'; button.classList.remove('copied'); }, 2000); }); }); }); // Close button functionality: Navigates back to index page document.getElementById('closeBtn').addEventListener('click', () => { window.location.href = 'index.html'; }); </script> <script src="script.js" onerror="void(0)"></script> </body> </html>