HTML Tables
From w3cyberlearnings
Contents |
HTML - TABLE
You can create HTML table to store content or information.
HTML - Syntax TABLE
<table> <tr><td>Cell</td><td>Cell 2</td><tr> </table>
HTML Table Tags
Tag | Description |
---|---|
table | Specifies table |
th | Specifies a table header |
tr | Specifies a table row |
td | Specifies a table cell |
caption | Specifies a table caption |
colgroup | Group of columns in table for formatting. |
col | Specifies attribute values for one or more columns in a table |
thead | Specifies a table head |
thead | Groups a table head |
tbody | Groups a table body content |
tfoot | Groups a table footer content. |
Example 1 TRY-IT
<table border="1"> <tr><th>Fruits</th><th>Price</th></tr> <tr><td>Mango</td><td>0.98</td></tr> <tr><td>Orange</td><td>0.88</td></tr> <tr><td>Apple</td><td>1.30</td></tr> <tr><td>Banana</td><td>0.48</td></tr> </table>
Output
Example 2 TRY-IT
<table border="1"> <tr><th>Subject</th><th>Score</th><th>Average</th></tr> <tr><th>English</th><td>98</td><td>82</td></tr> <tr><th>Maths</th><td>84</td><td>78</td></tr> <tr><th>Physics</th><td>95</td><td>88</td></tr> <tr><th>History</th><td>86</td><td>78</td></tr> <tr><th>Science</th><td>88</td><td>93</td></tr> </table>
Output
Related Link
- HTML - Tables
- HTML - Box Container
- HTML - Columns
- HTML - Navigation
- HTML - Layout