Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border Spacing #380

Closed
jkniest opened this issue Feb 9, 2018 · 11 comments · Fixed by #7102
Closed

Border Spacing #380

jkniest opened this issue Feb 9, 2018 · 11 comments · Fixed by #7102

Comments

@jkniest
Copy link

jkniest commented Feb 9, 2018

Hey,

I just wanted to ask if something related to "border-spacing" is planed?

The default table layout does include border-spacing: 2px which is kind of annoying since I wanted to add a bottom border after the table head.

With border-spacing 2:
bildschirmfoto 2018-02-09 um 23 37 21

With border-spacing 0:
bildschirmfoto 2018-02-09 um 23 37 51

See also: https://www.w3schools.com/cssref/pr_border-spacing.asp

Have a nice day,
Jordan

@minthemiddle
Copy link

+1

Default Border Spacing is a problem.
You cannot add a continuous background color to tables because of this.

See http:https://jsbin.com/soxeqat/edit?html,output

@adamwathan
Copy link
Member

We're planning to add some table related utilities in the near future but in the mean time you can easily add your own utilities:

https://tailwindcss.com/docs/adding-new-utilities

@adamwathan
Copy link
Member

Looking at getting some of this stuff added soon but quick question, do you actually want border-spacing: 0 or do you just need border-collapse: collapse? It would be nice to avoid adding another scale to the config file for border spacing if people really just care about removing border spacing altogether.

@minthemiddle
Copy link

For the continuous background color problem, border-collapse: collapse would be enough of a solution. See: http:https://jsbin.com/culebiluca/2

@jkniest
Copy link
Author

jkniest commented Mar 14, 2018

@adamwathan Yeah border-collapse: collapse should be enough. I didn't knew about this css "command".

@adamwathan
Copy link
Member

We have border collapse utilities now as of v0.6.0 👍

@zacharypodbela
Copy link

zacharypodbela commented Dec 15, 2020

There is an edge case where border-collapse does not work: it does not allow you to apply a continuous rounded border to a table element.

  • One option as detailed in this Stack Overflow is to use border-collapse and apply styles to the last and first td child of the last and first tr children.
  • The other options is to apply border-spacing: 0; and use border-separate.

Are there any plans to add support for changing border-spacing to tailwind?

@OD91
Copy link

OD91 commented May 18, 2021

I have a table, with:

  • a right border of the first column
  • and a border of the table head (first row or th tag)

These borders are supposed to be sticky when scrolling on the x- and y-axis. This case just works with border-separate but here the default is border-spacing: 2px. For a cleaner look I would need a border-spacing: 0px...

So, any progress regarding the question above? "Are there any plans to add support for changing border-spacing"

@epitaphmike
Copy link

Seem like adding your own utility is your best bet for now. With JIT enabled, it'll be nice to see this added to the core library
@adamwathan

@layer utilities {
  .border-spacing-0 {
    border-spacing: 0;
  }
}

@demeralde
Copy link

I'm also in need of this. I think this should be included in Tailwind's stock utilities.

@reinink
Copy link
Member

reinink commented Mar 4, 2022

Hey all, just letting you know that we've officially added border-spacing utilities to Tailwind CSS, thanks to the work of @JuanM04. This will be part of the upcoming v3.1.0 release, but if you want to use it right away, you can use an insiders release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants