How to create a table in HTML

problem

You wish to add a table in your HTML page. This post shows how to create a simple table with couple of rows and columns.

SOLUTION

In HTML, we can use the <table> tag to specify an element that will be table. Tables are usually for tabular data. The opening table tag needs to be followed by a closing tag as shown below.

				
					<table>
    
</table>
				
			
adding header

Most of the tables use the first row as headers. We can accomplish this by using the <thead> tag. Inside the thead we will add a table row by using the <tr> tag and inside that we will add 2 columns (table headers) by using the <th> tag.

				
					<table>
			<thead>
				<tr>
					<th>column 1</th>
					<th>column 2</th>
				</tr>	
			</thead>
		</table>
				
			
adding body

Now, let’s add the contents of the table by using the <tbody> tag. Inside that we will add 3 rows again by using the <tr> tag and in each row we will add 2 cells by using the table data tag <td>

				
						<table>
			<thead>
				<tr>
					<th>column 1</th>
					<th>column 2</th>
				</tr>	
			</thead>
			<tbody>
				<tr>
					<td>cell 1</td>
					<td>cell 2</td>
				</tr>
				<tr>
					<td>cell 3</td>
					<td>cell 4</td>
				</tr>
			</tbody>
		</table>
				
			

output

The data are shown in a tabular format as expected. Of course if we wish to style it with some borders and colors we will need to add CSS.

For example adding the following CSS will add two different background colors on the table

				
					tr{
				background-color: lightskyblue;
			}
			th{
				background-color: lightgreen;
			}
				
			

For simplicity the CSS can be added inside the <style> tag that goes inside the <head> tag as shown below. Recall we can specify CSS on our HTML in 3 different ways.

				
						<head>
		<style>
			tr{
				background-color: lightskyblue;
			}
			th{
				background-color: lightgreen;
			}
		</style>
	<style id="wpr-lazyload-bg-container"></style><style id="wpr-lazyload-bg-exclusion"></style>
<noscript>
<style id="wpr-lazyload-bg-nostyle">#wpdiscuz-loading-bar{--wpr-bg-dc12a1ac-6a92-4d01-84d1-48f5a714fe26: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/img/loading.gif');}#cboxOverlay{--wpr-bg-c692efff-8031-47af-becd-98fad44d6da2: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/overlay.png');}#cboxTopLeft{--wpr-bg-dde10114-8a62-4ed0-b536-5719e9e21564: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxTopRight{--wpr-bg-aa1fc68c-5de0-4571-9a31-894881362a20: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxBottomLeft{--wpr-bg-108624c0-22c9-48ab-8a98-67e600bc26ea: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxBottomRight{--wpr-bg-bf2e4156-0f04-4d66-b621-1170a45ead46: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxMiddleLeft{--wpr-bg-446d2035-ae47-4ed0-a1a3-f72d0979c17e: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxMiddleRight{--wpr-bg-44b4d07b-06bd-43ca-86d6-33e965754a09: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxTopCenter{--wpr-bg-1b7f6368-79ed-43f2-8f15-9896ef066692: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/border.png');}#cboxBottomCenter{--wpr-bg-e7f805fb-b9c7-49d9-bf70-459fa85b9fc2: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/border.png');}#cboxLoadingOverlay{--wpr-bg-46383173-01ac-47da-ac4e-343ed71b997f: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/loading_background.png');}#cboxLoadingGraphic{--wpr-bg-e35c355b-5df3-4174-9acc-23d4e588b80c: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/loading.gif');}#cboxPrevious{--wpr-bg-87b6ba4b-a0ce-4ae3-b6da-ad2e0038681e: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxNext{--wpr-bg-37c0fea0-eae0-43de-bd16-fd6380fd21fe: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxClose{--wpr-bg-2b27cea5-fea5-4160-8be4-ae57a0a45585: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}.rll-youtube-player .play{--wpr-bg-10b45e95-8aba-4307-b0e3-e75411fb8f22: url('https://programmerabroad.com/wp-content/plugins/wp-rocket/assets/img/youtube.png');}</style>
</noscript>
<script type="application/javascript">const rocket_pairs = [{"selector":"#wpdiscuz-loading-bar","style":"#wpdiscuz-loading-bar{--wpr-bg-dc12a1ac-6a92-4d01-84d1-48f5a714fe26: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif');}","hash":"dc12a1ac-6a92-4d01-84d1-48f5a714fe26","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif"},{"selector":"#cboxOverlay","style":"#cboxOverlay{--wpr-bg-c692efff-8031-47af-becd-98fad44d6da2: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/overlay.png');}","hash":"c692efff-8031-47af-becd-98fad44d6da2","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/overlay.png"},{"selector":"#cboxTopLeft","style":"#cboxTopLeft{--wpr-bg-dde10114-8a62-4ed0-b536-5719e9e21564: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"dde10114-8a62-4ed0-b536-5719e9e21564","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxTopRight","style":"#cboxTopRight{--wpr-bg-aa1fc68c-5de0-4571-9a31-894881362a20: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"aa1fc68c-5de0-4571-9a31-894881362a20","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxBottomLeft","style":"#cboxBottomLeft{--wpr-bg-108624c0-22c9-48ab-8a98-67e600bc26ea: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"108624c0-22c9-48ab-8a98-67e600bc26ea","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxBottomRight","style":"#cboxBottomRight{--wpr-bg-bf2e4156-0f04-4d66-b621-1170a45ead46: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"bf2e4156-0f04-4d66-b621-1170a45ead46","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxMiddleLeft","style":"#cboxMiddleLeft{--wpr-bg-446d2035-ae47-4ed0-a1a3-f72d0979c17e: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"446d2035-ae47-4ed0-a1a3-f72d0979c17e","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxMiddleRight","style":"#cboxMiddleRight{--wpr-bg-44b4d07b-06bd-43ca-86d6-33e965754a09: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"44b4d07b-06bd-43ca-86d6-33e965754a09","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxTopCenter","style":"#cboxTopCenter{--wpr-bg-1b7f6368-79ed-43f2-8f15-9896ef066692: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png');}","hash":"1b7f6368-79ed-43f2-8f15-9896ef066692","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png"},{"selector":"#cboxBottomCenter","style":"#cboxBottomCenter{--wpr-bg-e7f805fb-b9c7-49d9-bf70-459fa85b9fc2: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png');}","hash":"e7f805fb-b9c7-49d9-bf70-459fa85b9fc2","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png"},{"selector":"#cboxLoadingOverlay","style":"#cboxLoadingOverlay{--wpr-bg-46383173-01ac-47da-ac4e-343ed71b997f: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading_background.png');}","hash":"46383173-01ac-47da-ac4e-343ed71b997f","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading_background.png"},{"selector":"#cboxLoadingGraphic","style":"#cboxLoadingGraphic{--wpr-bg-e35c355b-5df3-4174-9acc-23d4e588b80c: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading.gif');}","hash":"e35c355b-5df3-4174-9acc-23d4e588b80c","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading.gif"},{"selector":"#cboxPrevious","style":"#cboxPrevious{--wpr-bg-87b6ba4b-a0ce-4ae3-b6da-ad2e0038681e: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"87b6ba4b-a0ce-4ae3-b6da-ad2e0038681e","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxNext","style":"#cboxNext{--wpr-bg-37c0fea0-eae0-43de-bd16-fd6380fd21fe: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"37c0fea0-eae0-43de-bd16-fd6380fd21fe","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxClose","style":"#cboxClose{--wpr-bg-2b27cea5-fea5-4160-8be4-ae57a0a45585: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"2b27cea5-fea5-4160-8be4-ae57a0a45585","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":".rll-youtube-player .play","style":".rll-youtube-player .play{--wpr-bg-10b45e95-8aba-4307-b0e3-e75411fb8f22: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wp-rocket\/assets\/img\/youtube.png');}","hash":"10b45e95-8aba-4307-b0e3-e75411fb8f22","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wp-rocket\/assets\/img\/youtube.png"}]; const rocket_excluded_pairs = [];</script></head>
				
			

The <head> always appears first in HTML, before <body>. Below is the complete HTML

				
					<html>
	<head>
		<style>
			tr{
				background-color: lightskyblue;
			}
			th{
				background-color: lightgreen;
			}
		</style>
	<style id="wpr-lazyload-bg-container"></style><style id="wpr-lazyload-bg-exclusion"></style>
<noscript>
<style id="wpr-lazyload-bg-nostyle">#wpdiscuz-loading-bar{--wpr-bg-dc12a1ac-6a92-4d01-84d1-48f5a714fe26: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/img/loading.gif');}#cboxOverlay{--wpr-bg-c692efff-8031-47af-becd-98fad44d6da2: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/overlay.png');}#cboxTopLeft{--wpr-bg-dde10114-8a62-4ed0-b536-5719e9e21564: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxTopRight{--wpr-bg-aa1fc68c-5de0-4571-9a31-894881362a20: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxBottomLeft{--wpr-bg-108624c0-22c9-48ab-8a98-67e600bc26ea: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxBottomRight{--wpr-bg-bf2e4156-0f04-4d66-b621-1170a45ead46: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxMiddleLeft{--wpr-bg-446d2035-ae47-4ed0-a1a3-f72d0979c17e: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxMiddleRight{--wpr-bg-44b4d07b-06bd-43ca-86d6-33e965754a09: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxTopCenter{--wpr-bg-1b7f6368-79ed-43f2-8f15-9896ef066692: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/border.png');}#cboxBottomCenter{--wpr-bg-e7f805fb-b9c7-49d9-bf70-459fa85b9fc2: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/border.png');}#cboxLoadingOverlay{--wpr-bg-46383173-01ac-47da-ac4e-343ed71b997f: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/loading_background.png');}#cboxLoadingGraphic{--wpr-bg-e35c355b-5df3-4174-9acc-23d4e588b80c: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/loading.gif');}#cboxPrevious{--wpr-bg-87b6ba4b-a0ce-4ae3-b6da-ad2e0038681e: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxNext{--wpr-bg-37c0fea0-eae0-43de-bd16-fd6380fd21fe: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}#cboxClose{--wpr-bg-2b27cea5-fea5-4160-8be4-ae57a0a45585: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/css/images/controls.png');}.rll-youtube-player .play{--wpr-bg-10b45e95-8aba-4307-b0e3-e75411fb8f22: url('https://programmerabroad.com/wp-content/plugins/wp-rocket/assets/img/youtube.png');}</style>
</noscript>
<script type="application/javascript">const rocket_pairs = [{"selector":"#wpdiscuz-loading-bar","style":"#wpdiscuz-loading-bar{--wpr-bg-dc12a1ac-6a92-4d01-84d1-48f5a714fe26: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif');}","hash":"dc12a1ac-6a92-4d01-84d1-48f5a714fe26","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif"},{"selector":"#cboxOverlay","style":"#cboxOverlay{--wpr-bg-c692efff-8031-47af-becd-98fad44d6da2: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/overlay.png');}","hash":"c692efff-8031-47af-becd-98fad44d6da2","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/overlay.png"},{"selector":"#cboxTopLeft","style":"#cboxTopLeft{--wpr-bg-dde10114-8a62-4ed0-b536-5719e9e21564: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"dde10114-8a62-4ed0-b536-5719e9e21564","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxTopRight","style":"#cboxTopRight{--wpr-bg-aa1fc68c-5de0-4571-9a31-894881362a20: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"aa1fc68c-5de0-4571-9a31-894881362a20","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxBottomLeft","style":"#cboxBottomLeft{--wpr-bg-108624c0-22c9-48ab-8a98-67e600bc26ea: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"108624c0-22c9-48ab-8a98-67e600bc26ea","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxBottomRight","style":"#cboxBottomRight{--wpr-bg-bf2e4156-0f04-4d66-b621-1170a45ead46: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"bf2e4156-0f04-4d66-b621-1170a45ead46","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxMiddleLeft","style":"#cboxMiddleLeft{--wpr-bg-446d2035-ae47-4ed0-a1a3-f72d0979c17e: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"446d2035-ae47-4ed0-a1a3-f72d0979c17e","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxMiddleRight","style":"#cboxMiddleRight{--wpr-bg-44b4d07b-06bd-43ca-86d6-33e965754a09: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"44b4d07b-06bd-43ca-86d6-33e965754a09","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxTopCenter","style":"#cboxTopCenter{--wpr-bg-1b7f6368-79ed-43f2-8f15-9896ef066692: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png');}","hash":"1b7f6368-79ed-43f2-8f15-9896ef066692","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png"},{"selector":"#cboxBottomCenter","style":"#cboxBottomCenter{--wpr-bg-e7f805fb-b9c7-49d9-bf70-459fa85b9fc2: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png');}","hash":"e7f805fb-b9c7-49d9-bf70-459fa85b9fc2","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/border.png"},{"selector":"#cboxLoadingOverlay","style":"#cboxLoadingOverlay{--wpr-bg-46383173-01ac-47da-ac4e-343ed71b997f: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading_background.png');}","hash":"46383173-01ac-47da-ac4e-343ed71b997f","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading_background.png"},{"selector":"#cboxLoadingGraphic","style":"#cboxLoadingGraphic{--wpr-bg-e35c355b-5df3-4174-9acc-23d4e588b80c: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading.gif');}","hash":"e35c355b-5df3-4174-9acc-23d4e588b80c","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/loading.gif"},{"selector":"#cboxPrevious","style":"#cboxPrevious{--wpr-bg-87b6ba4b-a0ce-4ae3-b6da-ad2e0038681e: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"87b6ba4b-a0ce-4ae3-b6da-ad2e0038681e","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxNext","style":"#cboxNext{--wpr-bg-37c0fea0-eae0-43de-bd16-fd6380fd21fe: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"37c0fea0-eae0-43de-bd16-fd6380fd21fe","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":"#cboxClose","style":"#cboxClose{--wpr-bg-2b27cea5-fea5-4160-8be4-ae57a0a45585: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png');}","hash":"2b27cea5-fea5-4160-8be4-ae57a0a45585","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/css\/images\/controls.png"},{"selector":".rll-youtube-player .play","style":".rll-youtube-player .play{--wpr-bg-10b45e95-8aba-4307-b0e3-e75411fb8f22: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wp-rocket\/assets\/img\/youtube.png');}","hash":"10b45e95-8aba-4307-b0e3-e75411fb8f22","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wp-rocket\/assets\/img\/youtube.png"}]; const rocket_excluded_pairs = [];</script></head>
	<body>
		<table>
			<thead>
				<tr>
					<th>column 1</th>
					<th>column 2</th>
				</tr>	
			</thead>
			<tbody>
				<tr>
					<td>cell 1</td>
					<td>cell 2</td>
				</tr>
				<tr>
					<td>cell 3</td>
					<td>cell 4</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>
				
			

conclusion

In this post we saw how to create a simple table with two columns and two rows. Tables are widely used.

references

Share it!

Facebook
Twitter
LinkedIn
Reddit
Picture of Ellion

Ellion

Professional IT consultant, writer, programmer enthusiast interested in all sorts of coding.
Eats all cookies 🍪

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x