How to create a table in HTML

Home / HTML / How to create a table in HTML
Published on September 1, 2022
Updated on August 17, 2026
2 min read

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-7a55906a-4cf3-4f1f-ac6b-980e65a24080: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/img/loading.gif');}#cboxOverlay{--wpr-bg-29e3ff38-5b3b-4529-b23a-7e25d36a1257: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/overlay.png');}#cboxTopLeft{--wpr-bg-425496e2-b77d-41b2-8e71-42c579e940e4: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxTopRight{--wpr-bg-03e631a0-20c1-48f0-9094-4c258408a3ac: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxBottomLeft{--wpr-bg-209dd13b-bcfb-48d1-9525-3fccdb56c1cb: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxBottomRight{--wpr-bg-cf9e6b72-547c-44ba-9735-46a2f9a20103: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxMiddleLeft{--wpr-bg-0544f484-08d6-4389-91af-7fec92e7bf02: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxMiddleRight{--wpr-bg-3a324847-690a-4867-879b-38cb0d6d17fe: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxTopCenter{--wpr-bg-188e4a20-c17d-4789-9a1f-db3306d6107f: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/border.png');}#cboxBottomCenter{--wpr-bg-44d20164-63eb-43fa-a56d-44b638355216: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/border.png');}#cboxLoadingOverlay{--wpr-bg-a8fbdc2f-1ef8-48bd-a058-c4b4de73b042: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/loading_background.png');}#cboxLoadingGraphic{--wpr-bg-6f3db8fe-def3-42d7-a734-f3cc742c533f: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/loading.gif');}#cboxPrevious{--wpr-bg-5afec16d-d436-40d8-82a1-eb8774559495: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxNext{--wpr-bg-6f27869b-d573-49f2-8c06-320e117f2dae: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxClose{--wpr-bg-533f841b-a66e-46c2-b36a-54c5eaf46820: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}.rll-youtube-player .play{--wpr-bg-063857de-c526-4aca-a1cf-5be08878f48a: 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-7a55906a-4cf3-4f1f-ac6b-980e65a24080: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif');}","hash":"7a55906a-4cf3-4f1f-ac6b-980e65a24080","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif"},{"selector":"#cboxOverlay","style":"#cboxOverlay{--wpr-bg-29e3ff38-5b3b-4529-b23a-7e25d36a1257: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/overlay.png');}","hash":"29e3ff38-5b3b-4529-b23a-7e25d36a1257","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/overlay.png"},{"selector":"#cboxTopLeft","style":"#cboxTopLeft{--wpr-bg-425496e2-b77d-41b2-8e71-42c579e940e4: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"425496e2-b77d-41b2-8e71-42c579e940e4","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxTopRight","style":"#cboxTopRight{--wpr-bg-03e631a0-20c1-48f0-9094-4c258408a3ac: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"03e631a0-20c1-48f0-9094-4c258408a3ac","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxBottomLeft","style":"#cboxBottomLeft{--wpr-bg-209dd13b-bcfb-48d1-9525-3fccdb56c1cb: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"209dd13b-bcfb-48d1-9525-3fccdb56c1cb","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxBottomRight","style":"#cboxBottomRight{--wpr-bg-cf9e6b72-547c-44ba-9735-46a2f9a20103: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"cf9e6b72-547c-44ba-9735-46a2f9a20103","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxMiddleLeft","style":"#cboxMiddleLeft{--wpr-bg-0544f484-08d6-4389-91af-7fec92e7bf02: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"0544f484-08d6-4389-91af-7fec92e7bf02","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxMiddleRight","style":"#cboxMiddleRight{--wpr-bg-3a324847-690a-4867-879b-38cb0d6d17fe: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"3a324847-690a-4867-879b-38cb0d6d17fe","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxTopCenter","style":"#cboxTopCenter{--wpr-bg-188e4a20-c17d-4789-9a1f-db3306d6107f: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png');}","hash":"188e4a20-c17d-4789-9a1f-db3306d6107f","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png"},{"selector":"#cboxBottomCenter","style":"#cboxBottomCenter{--wpr-bg-44d20164-63eb-43fa-a56d-44b638355216: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png');}","hash":"44d20164-63eb-43fa-a56d-44b638355216","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png"},{"selector":"#cboxLoadingOverlay","style":"#cboxLoadingOverlay{--wpr-bg-a8fbdc2f-1ef8-48bd-a058-c4b4de73b042: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading_background.png');}","hash":"a8fbdc2f-1ef8-48bd-a058-c4b4de73b042","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading_background.png"},{"selector":"#cboxLoadingGraphic","style":"#cboxLoadingGraphic{--wpr-bg-6f3db8fe-def3-42d7-a734-f3cc742c533f: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading.gif');}","hash":"6f3db8fe-def3-42d7-a734-f3cc742c533f","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading.gif"},{"selector":"#cboxPrevious","style":"#cboxPrevious{--wpr-bg-5afec16d-d436-40d8-82a1-eb8774559495: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"5afec16d-d436-40d8-82a1-eb8774559495","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxNext","style":"#cboxNext{--wpr-bg-6f27869b-d573-49f2-8c06-320e117f2dae: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"6f27869b-d573-49f2-8c06-320e117f2dae","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxClose","style":"#cboxClose{--wpr-bg-533f841b-a66e-46c2-b36a-54c5eaf46820: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"533f841b-a66e-46c2-b36a-54c5eaf46820","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":".rll-youtube-player .play","style":".rll-youtube-player .play{--wpr-bg-063857de-c526-4aca-a1cf-5be08878f48a: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wp-rocket\/assets\/img\/youtube.png');}","hash":"063857de-c526-4aca-a1cf-5be08878f48a","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-7a55906a-4cf3-4f1f-ac6b-980e65a24080: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/img/loading.gif');}#cboxOverlay{--wpr-bg-29e3ff38-5b3b-4529-b23a-7e25d36a1257: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/overlay.png');}#cboxTopLeft{--wpr-bg-425496e2-b77d-41b2-8e71-42c579e940e4: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxTopRight{--wpr-bg-03e631a0-20c1-48f0-9094-4c258408a3ac: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxBottomLeft{--wpr-bg-209dd13b-bcfb-48d1-9525-3fccdb56c1cb: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxBottomRight{--wpr-bg-cf9e6b72-547c-44ba-9735-46a2f9a20103: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxMiddleLeft{--wpr-bg-0544f484-08d6-4389-91af-7fec92e7bf02: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxMiddleRight{--wpr-bg-3a324847-690a-4867-879b-38cb0d6d17fe: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxTopCenter{--wpr-bg-188e4a20-c17d-4789-9a1f-db3306d6107f: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/border.png');}#cboxBottomCenter{--wpr-bg-44d20164-63eb-43fa-a56d-44b638355216: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/border.png');}#cboxLoadingOverlay{--wpr-bg-a8fbdc2f-1ef8-48bd-a058-c4b4de73b042: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/loading_background.png');}#cboxLoadingGraphic{--wpr-bg-6f3db8fe-def3-42d7-a734-f3cc742c533f: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/loading.gif');}#cboxPrevious{--wpr-bg-5afec16d-d436-40d8-82a1-eb8774559495: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxNext{--wpr-bg-6f27869b-d573-49f2-8c06-320e117f2dae: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}#cboxClose{--wpr-bg-533f841b-a66e-46c2-b36a-54c5eaf46820: url('https://programmerabroad.com/wp-content/plugins/wpdiscuz/assets/third-party/colorbox/images/controls.png');}.rll-youtube-player .play{--wpr-bg-063857de-c526-4aca-a1cf-5be08878f48a: 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-7a55906a-4cf3-4f1f-ac6b-980e65a24080: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif');}","hash":"7a55906a-4cf3-4f1f-ac6b-980e65a24080","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/img\/loading.gif"},{"selector":"#cboxOverlay","style":"#cboxOverlay{--wpr-bg-29e3ff38-5b3b-4529-b23a-7e25d36a1257: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/overlay.png');}","hash":"29e3ff38-5b3b-4529-b23a-7e25d36a1257","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/overlay.png"},{"selector":"#cboxTopLeft","style":"#cboxTopLeft{--wpr-bg-425496e2-b77d-41b2-8e71-42c579e940e4: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"425496e2-b77d-41b2-8e71-42c579e940e4","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxTopRight","style":"#cboxTopRight{--wpr-bg-03e631a0-20c1-48f0-9094-4c258408a3ac: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"03e631a0-20c1-48f0-9094-4c258408a3ac","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxBottomLeft","style":"#cboxBottomLeft{--wpr-bg-209dd13b-bcfb-48d1-9525-3fccdb56c1cb: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"209dd13b-bcfb-48d1-9525-3fccdb56c1cb","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxBottomRight","style":"#cboxBottomRight{--wpr-bg-cf9e6b72-547c-44ba-9735-46a2f9a20103: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"cf9e6b72-547c-44ba-9735-46a2f9a20103","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxMiddleLeft","style":"#cboxMiddleLeft{--wpr-bg-0544f484-08d6-4389-91af-7fec92e7bf02: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"0544f484-08d6-4389-91af-7fec92e7bf02","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxMiddleRight","style":"#cboxMiddleRight{--wpr-bg-3a324847-690a-4867-879b-38cb0d6d17fe: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"3a324847-690a-4867-879b-38cb0d6d17fe","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxTopCenter","style":"#cboxTopCenter{--wpr-bg-188e4a20-c17d-4789-9a1f-db3306d6107f: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png');}","hash":"188e4a20-c17d-4789-9a1f-db3306d6107f","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png"},{"selector":"#cboxBottomCenter","style":"#cboxBottomCenter{--wpr-bg-44d20164-63eb-43fa-a56d-44b638355216: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png');}","hash":"44d20164-63eb-43fa-a56d-44b638355216","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/border.png"},{"selector":"#cboxLoadingOverlay","style":"#cboxLoadingOverlay{--wpr-bg-a8fbdc2f-1ef8-48bd-a058-c4b4de73b042: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading_background.png');}","hash":"a8fbdc2f-1ef8-48bd-a058-c4b4de73b042","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading_background.png"},{"selector":"#cboxLoadingGraphic","style":"#cboxLoadingGraphic{--wpr-bg-6f3db8fe-def3-42d7-a734-f3cc742c533f: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading.gif');}","hash":"6f3db8fe-def3-42d7-a734-f3cc742c533f","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/loading.gif"},{"selector":"#cboxPrevious","style":"#cboxPrevious{--wpr-bg-5afec16d-d436-40d8-82a1-eb8774559495: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"5afec16d-d436-40d8-82a1-eb8774559495","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxNext","style":"#cboxNext{--wpr-bg-6f27869b-d573-49f2-8c06-320e117f2dae: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"6f27869b-d573-49f2-8c06-320e117f2dae","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":"#cboxClose","style":"#cboxClose{--wpr-bg-533f841b-a66e-46c2-b36a-54c5eaf46820: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png');}","hash":"533f841b-a66e-46c2-b36a-54c5eaf46820","url":"https:\/\/programmerabroad.com\/wp-content\/plugins\/wpdiscuz\/assets\/third-party\/colorbox\/images\/controls.png"},{"selector":".rll-youtube-player .play","style":".rll-youtube-player .play{--wpr-bg-063857de-c526-4aca-a1cf-5be08878f48a: url('https:\/\/programmerabroad.com\/wp-content\/plugins\/wp-rocket\/assets\/img\/youtube.png');}","hash":"063857de-c526-4aca-a1cf-5be08878f48a","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