Published on

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

Table Social

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

  1. Control the vertical padding of an element to 0.25rem using the py-1 utilities.

  2. Control the background color of an element to blueGray-50 using the bg-blueGray-50 utilities.

  3. Use w-full to set an element to a 100% based width.

  4. Use xl:w-4/12 to set an element to a fixed width(4/12) at only extremely large screen sizes.

  5. Control the horizontal padding of an element to 1rem using the px-4 utilities.

  6. Control the horizontal margin of an element to auto using the mx-auto utilities.

  7. Control the margin on top side of an element to 6rem using the mt-24 utilities.

  8. Use relative to position an element according to the normal flow of the document.

  9. Use flex to create a block-level flex container.

  10. Use flex to create a block-level flex container.

  11. Set the minimum width/height of an element using the min-w-0 utilities.

  12. Control the margin on bottom side of an element to 1.5rem using the mb-6 utilities.

  13. Control the background color of an element to white using the bg-white utilities.

  14. Control the margin on bottom side of an element to 0rem using the mb-0 utilities.

  15. Control the vertical padding of an element to 0.75rem using the py-3 utilities.

  16. Control the border color of an element to 0rem using the border-0 utilities.

  17. Use flex to create a block-level flex container.

  18. Set the maximum width/height of an element using the max-w-full utilities.

  19. Use flex to create a block-level flex container.

  20. Use flex to create a block-level flex container.

  21. Control the text color of an element to base using the text-base utilities.

  22. Control the text color of an element to blueGray-700 using the text-blueGray-700 utilities.

  23. Control the text color of an element to right using the text-right utilities.

  24. Control the background color of an element to indigo-500 using the bg-indigo-500 utilities.

  25. Control the text color of an element to white using the text-white utilities.

  26. Control the background color of an element to indigo-600 using the active:bg-indigo-600 utilities on active.

  27. Control the text color of an element to xs using the text-xs utilities.

  28. Control the horizontal padding of an element to 0.75rem using the px-3 utilities.

  29. Control the margin on right side of an element to 0.25rem using the mr-1 utilities.

  30. Control the margin on bottom side of an element to 0.25rem using the mb-1 utilities.

  31. Use inline utilities to put the element on its own line and fill its parent.

  32. Use overflow-x-auto to allow horizontal scrolling if needed.

  33. Control the border color of an element to collapse using the border-collapse utilities.

  34. Control the horizontal padding of an element to 1.5rem using the px-6 utilities.

  35. Control the text color of an element to blueGray-500 using the text-blueGray-500 utilities.

  36. Control the border color of an element to solid using the border-solid utilities.

  37. Control the border color of an element to blueGray-100 using the border-blueGray-100 utilities.

  38. Control the border color of an element to l-0 using the border-l-0 utilities.

  39. Control the border color of an element to r-0 using the border-r-0 utilities.

  40. Control the text color of an element to left using the text-left utilities.

  41. Set the minimum width/height of an element using the min-w-140-px utilities.

  42. Control the border color of an element to t-0 using the border-t-0 utilities.

  43. Control the padding on all sides of an element to 1rem using the p-4 utilities.

  44. Control the margin on right side of an element to 0.5rem using the mr-2 utilities.

  45. Use overflow-hidden to clip any content within an element that overflows the bounds of that element.

  46. Use h-2 to set an element to a fixed height(0.5rem).

  47. Control the background color of an element to red-200 using the bg-red-200 utilities.

  48. Control the text color of an element to center using the text-center utilities.

  49. Control the background color of an element to red-500 using the bg-red-500 utilities.

  50. Control the background color of an element to purple-200 using the bg-purple-200 utilities.

  51. Control the background color of an element to purple-500 using the bg-purple-500 utilities.

  52. Control the background color of an element to pink-500 using the bg-pink-500 utilities.

  53. Control the background color of an element to lightBlue-200 using the bg-lightBlue-200 utilities.

  54. Control the background color of an element to lightBlue-500 using the bg-lightBlue-500 utilities.

  55. Control the background color of an element to orange-200 using the bg-orange-200 utilities.

  56. Control the padding on top side of an element to 2rem using the pt-8 utilities.

  57. Control the padding on bottom side of an element to 1.5rem using the pb-6 utilities.

  58. Control the margin on top side of an element to 4rem using the mt-16 utilities.

  59. Use md:w-6/12 to set an element to a fixed width(6/12) at only medium screen sizes.

  60. Control the text color of an element to sm using the text-sm utilities.

  61. Control the text color of an element to gray-800 on hover using the hover:text-gray-800 utilities.

  62. 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.