tofsjonas / sortable

Vanilla JavaScript table sort
The Unlicense
429 stars 50 forks source link

(Suggestion) Put the arrows inside the padding #42

Closed Daviid-P closed 1 year ago

Daviid-P commented 1 year ago

If you text-align to the right you have something like this.

image

In the header there's a space for the arrows.

If we do this:

th {
  position: relative;
}
th::after {
  position: absolute;
}

we can put the arrows inside the padding and the text always aligns in th and td (assuming same text-align)

tofsjonas commented 1 year ago

I vaguely recall playing around with that, but deciding to put the arrows on the left side if aligning right. Something about the padding becoming trickier, but I can't quite remember. 🤔

Do you have a working example, so I can see how it looks?

Daviid-P commented 1 year ago

https://output.jsbin.com/qozobevije

tofsjonas commented 1 year ago

Yeah, I would definitely prefer arrows on the left side for that.

But you are free to do whatever you want, of course! 🥳