How to adjust tab width display in GitHub interface?

I’ve noticed that when browsing code files directly on GitHub’s web interface, the tab characters are displayed with a width of 8 spaces, which makes the code look quite spread out and harder to read.

For instance, when I open any file with indented code, the spacing appears much wider than what I’m used to in my local editor. This creates inconsistency between how I see the code locally versus on GitHub.

I was wondering if there’s a way to modify this setting so that tabs render as 2 or 4 spaces instead? This would make the code more compact and easier to follow, especially for deeply nested structures.

i totally get it! it’s super anoying when the tabs look so wide. there are browser extensions that can help size 'em down while you surf, but for a quick fix, just keep adding that setting. it’s a little hassle but way better than straining to read those giant gaps!