Border Spacing

    Utilities for controlling the spacing between table borders.

    Show all classes

    Use to control the space between the borders of table cells with .


    1. <table class="hover:border-spacing-2">
    2. <!-- ... -->
    3. </table>

    For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.

    You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:border-spacing-4 to apply the border-spacing-4 utility at only medium screen sizes and above.

    To learn more, check out the documentation on Responsive Design, and other media query modifiers.


    By default, Tailwind’s border spacing utilities use the . You can customize your spacing scale by editing theme.spacing or in your tailwind.config.js file.

    1. module.exports = {
    2. theme: {
    3. extend: {
    4. '13': '3.25rem',
    5. }
    6. }
    7. }

    Alternatively, you can customize just the border spacing scale by editing theme.borderSpacing or theme.extend.borderSpacing in your tailwind.config.js file.

    tailwind.config.js

    Learn more about customizing the default theme in the theme customization documentation.

    If you need to use a one-off border-spacing value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.

    1. <div class="border-spacing-[7px]">
    2. <!-- ... -->