Jump to: navigation, search

HTML Table Column

From w3cyberlearnings

Contents

HTML Table Column

Use <colgroup> tag to define the table column.

Example 1 TRY-IT

<table border="1">
	<colgroup span="2" style="background-color:blue"></colgroup>
	<colgroup style="background-color:green"></colgroup>
	<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>

Example 2 TRY-IT

<table border="1">
	<colgroup style="background-color:green"></colgroup>
	<colgroup span="2" style="background-color:blue"></colgroup>
	<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>

Related Link


Table
  1. HTML - Table
  2. HTML - Table Border
  3. HTML - Table Column
  4. HTML - Table Row
  5. HTML - Table Color
  6. HTML - Table Cell Spacing and Padding
  7. HTML - Text Align
  8. HTML - Text Vertical Align
  9. HTML - Table Caption and Summary
  10. HTML - Table thead, tbody, tfoot
  11. HTML - Inner Table
  12. HTML - Table Vertical Line
  13. HTML - Table Horizontal Line
Navigation
Web
SQL
MISC
References