Skip to main content

How to add table of content in Blog post

How to add table of content in Blog Post- If you want to categorize your content and put it in a systematic way in your blog post, then you should go for the table of content. Your user can access any particular element of your blog immediately according to his interest.

Let me show you how good Table of Content looks and gives your blog an attractive look.

Table of Content

So let's dive in and learn How to add table of content in Blogger?

Benefits of Table of Content

The table of content help you in a lot of ways, it has a lot of benefits as well as it helps you enhance your SEO. 
  • It arranges your data systematically.
  • It enhances your readability.
  • It has a good impact on your user.
  • Gives a free-hand to the user to access your blog easily.
  • It enhances your SEO
  • It makes the blog content look attractive.

SEO Benefits of Table of Content

As we all know that Google always prefers well structured and organized data, then if your blog post contains a table of content and you make your data organized in it, it will help to improve your SEO as well.

How to add Table of Content?

There are a few steps, that you can follow and add a table of content in your blog.
You have to follow all the steps as mentioned below to create a beautiful and attractive table of content.

Step 1:- First of all open your blogger dashboard and go to the theme section.

Table of Content

Click on Edit HTML button

Step 2:- Now you will be redirected to the page where you can edit your theme. Now you have to click at the random line of coding in your theme and then press Ctrl+F and then a search box will pop up on the top right side of the theme in which you have to search </head>  as shown in the image below.

Table of content

Step 3:- When you see the search result on your screen you had to copy the code which is given below, above </head> line.

<link href='' rel='stylesheet'/>           

<link href='' rel='stylesheet' type='text/css'/>

<script type='text/javascript'>              


function mbtTOC() {var mbtTOC=i=headlength=gethead=0;           
headlength = document.getElementById("post-toc").getElementsByTagName("h2").length;for (i = 0; i < headlength; i++)           

{gethead = document.getElementById("post-toc").getElementsByTagName("h2")[i].textContent;document.getElementById("post-toc").getElementsByTagName("h2")[i].setAttribute("id", "point"+i);mbtTOC = "<li><a href='#point"+i+"'>"+gethead+"</a></li>";document.getElementById("mbtTOC").innerHTML += mbtTOC;}}function mbtToggle() {var mbt = document.getElementById('mbtTOC');if (mbt .style.display === 'none') {mbt .style.display = 'block';} else {mbt .style.display = 'none';}}           

Step 4:- When you paste the code successfully above the given line then you have to search this in your search box again as shown in the picture below.


Table of content

Step 5:- After searching and getting the result again you have to paste the code given below above the searched line.

.mbtTOC{border:5px solid #f7f0b8;box-shadow:1px 1px 0 #EDE396;background-color:#FFFFE0;color:#707037;line-height:1.4em;margin:30px auto;padding:20px 30px 20px 10px; font-family:oswald, arial;display: block;width: 70%;}           
.mbtTOC ol,.mbtTOC ul {margin:0;padding:0;}           
.mbtTOC ul {list-style:none;}           
.mbtTOC ol li,.mbtTOC ul li {padding:15px 0 0; margin:0 0 0 30px;font-size:15px;}           
.mbtTOC a{color:#0080ff;text-decoration:none;}           
.mbtTOC a:hover{text-decoration:underline; }

.mbtTOC button{background:#FFFFE0; font-family:oswald, arial; font-size:20px;position:relative; outline:none;cursor:pointer; border:none; color:#707037;padding:0 0 0 15px;}           

.mbtTOC button:after{content: "\f0dc"; font-family:FontAwesome; position:relative; left:10px; font-size:20px;}

Step 6:- After pasting the code, again you have to search this code in your theme as shown in the image below.

NOTE:- How many times this code is in your theme, you have to replace them all.

Table of Content

Step 7:- Then replace the searched code by the code given below.

<div id="post-toc"><data:post.body/></div>

Step 8:- After doing this, you have to click on the save theme option, which is above the coding area.

Step 9:- After doing all of this you have to go to your post where you want to place the content table and then go to the HTML section of the code.

Table of Content

Step 10:- Now, you have to paste the code given below in the HTML section, where you want to show your content table in your post. As shown in the photo below.

<div class="mbtTOC"> 
    <button onclick="mbtToggle()">Table Of Contents</button> 
    <ul id="mbtTOC"></ul> 


Table of Content

Step 11:- Then go to the end of the HTML section and copy the code given below in the last line of the coding in the HTML section.


NOTE:- Whatever you want to show in your content table, you have to write them in Heading form, otherwise they will not be shown in your content table.

After doing the steps mentioned above you can add an attractive table of content in your blog and can make your blog more contentful and align.
I hope you like our post on How to add table of content in Blogger then share it with your friends and on social media platforms like Facebook, Whatsapp, and Instagram.