- Published on
How To Make A Table Social With Tailwind CSS In 5 Easy Steps

- What is Tailwind CSS?
- The description of Table Social ui component
- Why use Tailwind CSS to create a Table Social ui component?
- The preview of Table Social ui component
- The source code of Table Social ui component
- How to create a Table Social with Tailwind CSS?
- Install tailwind css of verion 2.2.4
- All the unility class needed to create a Table Social component
- 62 steps to create a Table Social component with Tailwind CSS
- Conclusion
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.
The description of Table Social ui component
Table social traffic data
Why use Tailwind CSS to create a Table Social ui component?
- It can make the building process of Table Social ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Table Social component file.
The preview of Table Social ui component
Free download of the Table Social's source code
The source code of Table Social ui component
<link rel="stylesheet" href="https://demos.creative-tim.com/notus-js/assets/styles/tailwind.css">
<link rel="stylesheet" href="https://demos.creative-tim.com/notus-js/assets/vendor/@fortawesome/fontawesome-free/css/all.min.css">
<section class="py-1 bg-blueGray-50">
<div class="w-full xl:w-4/12 px-4 mx-auto mt-24">
<div class="relative flex flex-col min-w-0 break-words w-full mb-6 shadow-lg rounded bg-white ">
<div class="rounded-t mb-0 px-4 py-3 border-0">
<div class="flex flex-wrap items-center">
<div class="relative w-full px-4 max-w-full flex-grow flex-1">
<h3 class="font-semibold text-base text-blueGray-700">
Social traffic
</h3>
</div>
<div class="relative w-full px-4 max-w-full flex-grow flex-1 text-right">
<button class="bg-indigo-500 text-white active:bg-indigo-600 text-xs font-bold uppercase px-3 py-1 rounded outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150" type="button">
See all
</button>
</div>
</div>
</div>
<div class="block w-full overflow-x-auto">
<table class="items-center w-full border-collapse text-blueGray-700 ">
<thead class="thead-light ">
<tr>
<th class="px-6 bg-blueGray-50 text-blueGray-500 align-middle border border-solid border-blueGray-100 py-3 text-xs uppercase border-l-0 border-r-0 whitespace-nowrap font-semibold text-left">
Referral
</th>
<th class="px-6 bg-blueGray-50 text-blueGray-500 align-middle border border-solid border-blueGray-100 py-3 text-xs uppercase border-l-0 border-r-0 whitespace-nowrap font-semibold text-left">
Visitors
</th>
<th class="px-6 bg-blueGray-50 text-blueGray-700 align-middle border border-solid border-blueGray-100 py-3 text-xs uppercase border-l-0 border-r-0 whitespace-nowrap font-semibold text-left min-w-140-px"></th>
</tr>
</thead>
<tbody>
<tr>
<th class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left">
Facebook
</th>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 ">
1,480
</td>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
<div class="flex items-center">
<span class="mr-2">60%</span>
<div class="relative w-full">
<div class="overflow-hidden h-2 text-xs flex rounded bg-red-200">
<div style="width: 60%" class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-red-500"></div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left">
Facebook
</th>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
5,480
</td>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
<div class="flex items-center">
<span class="mr-2">50%</span>
<div class="relative w-full">
<div class="overflow-hidden h-2 text-xs flex rounded bg-purple-200">
<div style="width: 50%" class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-purple-500"></div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left">
Google
</th>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
4,807
</td>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
<div class="flex items-center">
<span class="mr-2">60%</span>
<div class="relative w-full">
<div class="overflow-hidden h-2 text-xs flex rounded bg-purple-200">
<div style="width: 60%" class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-pink-500"></div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left">
Instagram
</th>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
3,678
</td>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
<div class="flex items-center">
<span class="mr-2">85%</span>
<div class="relative w-full">
<div class="overflow-hidden h-2 text-xs flex rounded bg-lightBlue-200">
<div style="width: 85%" class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-lightBlue-500"></div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<th class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4 text-left">
twitter
</th>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
2,645
</td>
<td class="border-t-0 px-6 align-middle border-l-0 border-r-0 text-xs whitespace-nowrap p-4">
<div class="flex items-center">
<span class="mr-2">60%</span>
<div class="relative w-full">
<div class="overflow-hidden h-2 text-xs flex rounded bg-orange-200">
<div style="width: 60%" class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-red-500"></div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<footer class="relative pt-8 pb-6 mt-16">
<div class="container mx-auto px-4">
<div class="flex flex-wrap items-center md:justify-between justify-center">
<div class="w-full md:w-6/12 px-4 mx-auto text-center">
<div class="text-sm text-blueGray-500 font-semibold py-1">
Made with <a href="https://www.creative-tim.com/product/notus-js" class="text-blueGray-500 hover:text-gray-800" target="_blank">Notus JS</a> by <a href="https://www.creative-tim.com" class="text-blueGray-500 hover:text-blueGray-800" target="_blank"> Creative Tim</a>.
</div>
</div>
</div>
</div>
</footer>
</section>
How to create a Table Social with Tailwind CSS?
Install tailwind css of verion 2.2.4
Use the script
html tag to import the script of Tailwind CSS of the version 2.2.4
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to create a Table Social component
py-1
bg-blueGray-50
w-full
xl:w-4/12
px-4
mx-auto
mt-24
relative
flex
flex-col
min-w-0
mb-6
bg-white
mb-0
py-3
border-0
flex-wrap
max-w-full
flex-grow
flex-1
text-base
text-blueGray-700
text-right
bg-indigo-500
text-white
active:bg-indigo-600
text-xs
px-3
mr-1
mb-1
block
overflow-x-auto
border-collapse
px-6
text-blueGray-500
border-solid
border-blueGray-100
border-l-0
border-r-0
text-left
min-w-140-px
border-t-0
p-4
mr-2
overflow-hidden
h-2
bg-red-200
text-center
bg-red-500
bg-purple-200
bg-purple-500
bg-pink-500
bg-lightBlue-200
bg-lightBlue-500
bg-orange-200
pt-8
pb-6
mt-16
md:w-6/12
text-sm
hover:text-gray-800
hover:text-blueGray-800
62 steps to create a Table Social component with Tailwind CSS
Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Control the background color of an element to blueGray-50 using the
bg-blueGray-50
utilities.Use
w-full
to set an element to a 100% based width.Use
xl:w-4/12
to set an element to a fixed width(4/12) at only extremely large screen sizes.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the margin on top side of an element to 6rem using the
mt-24
utilities.Use
relative
to position an element according to the normal flow of the document.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Set the minimum width/height of an element using the
min-w-0
utilities.Control the margin on bottom side of an element to 1.5rem using the
mb-6
utilities.Control the background color of an element to white using the
bg-white
utilities.Control the margin on bottom side of an element to 0rem using the
mb-0
utilities.Control the vertical padding of an element to 0.75rem using the
py-3
utilities.Control the border color of an element to 0rem using the
border-0
utilities.Use
flex
to create a block-level flex container.Set the maximum width/height of an element using the
max-w-full
utilities.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Control the text color of an element to base using the
text-base
utilities.Control the text color of an element to blueGray-700 using the
text-blueGray-700
utilities.Control the text color of an element to right using the
text-right
utilities.Control the background color of an element to indigo-500 using the
bg-indigo-500
utilities.Control the text color of an element to white using the
text-white
utilities.Control the background color of an element to indigo-600 using the
active:bg-indigo-600
utilities on active.Control the text color of an element to xs using the
text-xs
utilities.Control the horizontal padding of an element to 0.75rem using the
px-3
utilities.Control the margin on right side of an element to 0.25rem using the
mr-1
utilities.Control the margin on bottom side of an element to 0.25rem using the
mb-1
utilities.Use
inline
utilities to put the element on its own line and fill its parent.Use
overflow-x-auto
to allow horizontal scrolling if needed.Control the border color of an element to collapse using the
border-collapse
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the text color of an element to blueGray-500 using the
text-blueGray-500
utilities.Control the border color of an element to solid using the
border-solid
utilities.Control the border color of an element to blueGray-100 using the
border-blueGray-100
utilities.Control the border color of an element to l-0 using the
border-l-0
utilities.Control the border color of an element to r-0 using the
border-r-0
utilities.Control the text color of an element to left using the
text-left
utilities.Set the minimum width/height of an element using the
min-w-140-px
utilities.Control the border color of an element to t-0 using the
border-t-0
utilities.Control the padding on all sides of an element to 1rem using the
p-4
utilities.Control the margin on right side of an element to 0.5rem using the
mr-2
utilities.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Use
h-2
to set an element to a fixed height(0.5rem).Control the background color of an element to red-200 using the
bg-red-200
utilities.Control the text color of an element to center using the
text-center
utilities.Control the background color of an element to red-500 using the
bg-red-500
utilities.Control the background color of an element to purple-200 using the
bg-purple-200
utilities.Control the background color of an element to purple-500 using the
bg-purple-500
utilities.Control the background color of an element to pink-500 using the
bg-pink-500
utilities.Control the background color of an element to lightBlue-200 using the
bg-lightBlue-200
utilities.Control the background color of an element to lightBlue-500 using the
bg-lightBlue-500
utilities.Control the background color of an element to orange-200 using the
bg-orange-200
utilities.Control the padding on top side of an element to 2rem using the
pt-8
utilities.Control the padding on bottom side of an element to 1.5rem using the
pb-6
utilities.Control the margin on top side of an element to 4rem using the
mt-16
utilities.Use
md:w-6/12
to set an element to a fixed width(6/12) at only medium screen sizes.Control the text color of an element to sm using the
text-sm
utilities.Control the text color of an element to gray-800 on hover using the
hover:text-gray-800
utilities.Control the text color of an element to blueGray-800 on hover using the
hover:text-blueGray-800
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Table Social components, learn and follow along to implement your own components.