Building Your Learning Module...
Getting things ready for you!
Find videos you like?
Save to resource drawer for future reference!
HTML tables are used to display data in an organized, grid-like format with rows and columns. Use the <table> element to create a table,<tr> for rows,<th> for header cells, and<td> for data cells.
<table>
<tr>
<th>Header</th>
</tr>
<tr>
<td>Data</td>
</tr>
</table><table>Container for all table elements
<tr>Table row - contains cells
<th>Table header cell - bold and centered
<td>Table data cell - contains content
<table>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>This example shows a basic table displaying student grades. Notice the header row with <th> elements and data rows with <td> elements.
Basic table with rows and columns
<h3>Student Grades</h3>
<table>
<tr>
<th>Name</th>
<th>Math</th>
<th>Science</th>
<th>English</th>
</tr>
<tr>
<td>Alice</td>
<td>95</td>
<td>88</td>
<td>92</td>
</tr>
<tr>
<td>Bob</td>
<td>87</td>
<td>91</td>
<td>85</td>
</tr>
<tr>
<td>Charlie</td>
<td>92</td>
<td>94</td>
<td>89</td>
</tr>
</table>Loading preview...
This example demonstrates using CSS to style tables with alternating row colors for better readability.
Table with alternating colors
<h3>Weather This Week</h3>
<table>
<tr>
<th>Day</th>
<th>Temperature</th>
<th>Condition</th>
</tr>
<tr>
<td>Monday</td>
<td>72°F</td>
<td>Sunny</td>
</tr>
<tr>
<td>Tuesday</td>
<td>68°F</td>
<td>Cloudy</td>
</tr>
<tr>
<td>Wednesday</td>
<td>65°F</td>
<td>Rainy</td>
</tr>
<tr>
<td>Thursday</td>
<td>70°F</td>
<td>Partly Cloudy</td>
</tr>
</table>Loading preview...
Comparison tables are perfect for displaying different options side-by-side. This example shows pricing plans with different features.
Comparison table with pricing plans
<h3>Feature Comparison</h3>
<table>
<tr>
<th>Feature</th>
<th>Basic</th>
<th>Pro</th>
<th>Enterprise</th>
</tr>
<tr>
<td>Users</td>
<td>1</td>
<td>10</td>
<td>Unlimited</td>
</tr>
<tr>
<td>Storage</td>
<td>10 GB</td>
<td>100 GB</td>
<td>Unlimited</td>
</tr>
<tr>
<td>Support</td>
<td>Email</td>
<td>Priority</td>
<td>24/7 Phone</td>
</tr>
<tr>
<td>Analytics</td>
<td>❌</td>
<td>✓</td>
<td>✓</td>
</tr>
</table>Loading preview...
Organized information
Timetables and calendars
Plan comparisons
Product details
Financial data
Test or survey data