News:

Wondering if this will always be free?  See why free is better.

Main Menu

Tables are not centered in 2.1.4

Started by HelAu007, July 12, 2023, 06:54:51 AM

Previous topic - Next topic

Antechinus

Eh, bollocks. :P

Code (Sauces/Subs.php - Find this stuff) Select
array(
'tag' => 'center',
'before' => '<div class="centertext">',
'after' => '</div>',
'block_level' => true,
),

Code (Sauces/Subs.php - Replace that stuff with this stuff (you know you want to)) Select
array(
'tag' => 'center',
'before' => '<div class="centertext"><div>',
'after' => '</div></div>',
'block_level' => true,
),

Code (Thames/default/css/index.css - Now find this stuff) Select
.centertext, .centercol {
margin: 0 auto;
text-align: center;
}

Code (Thames/default/css/index.css - Bet you can't guess what to do with this stuff) Select
.centertext, .centercol {
margin: 0 auto;
text-align: center;
}
.centertext > div {
display: inline-block;
}

Iz all fixed now. Go have beer. :P

live627

Beer? Losers. Have tea like a Real Man! lmao

live627

Quote from: Antechinus on July 14, 2023, 09:29:19 PMBet you can't guess what to do with this stuff
Instructions unclear: Put Sauses into the River Thames but tables keep getting misaligned by cats. :D

live627

It works on my end by just adding a margin to the table

https://github.com/SimpleMachines/SMF/pull/7797

(I'm annoying the powers that be who loath serial posting muhahaha)

Antechinus

Yes, if you put an auto left and right margin on a block level element it will centre itself. However, you are still left with a "center" tag that will only centre inline elements, and still won't centre block level elements. I gave you code for a "center" tag that would centre everything. It's more versatile, and it's bulletproof, and the code changes are really simple, and it will stop people asking why your "center" tag doesn't centre whatever they feel like centering that day.

But hey, do wotcha like. No skin off my nose, sunshine. :D

Sir Osis of Liver

If it wasn't broke in 2.0, why was it fixed in 2.1?
When in Emor, do as the Snamors.
                              - D. Lister

live627


Antechinus

Quote from: Sir Osis of Liver on July 15, 2023, 10:41:15 PMIf it wasn't broke in 2.0, why was it fixed in 2.1?
I do believe I already explained that, but feel free to not bother reading. It makes the effort of explaining feel so worthwhile.

Sir Osis of Liver

You're beginning to sound like Arantor. :P  My attention span is rather brief, and memory is even worse, but I probably did read your explanation.  Water off a duck.
When in Emor, do as the Snamors.
                              - D. Lister

live627


Aleksi "Lex" Kilpinen

Quote from: Sir Osis of Liver on July 16, 2023, 05:13:27 PMYou're beginning to sound like Arantor. :P  My attention span is rather brief, and memory is even worse, but I probably did read your explanation.  Water off a duck.

The explanation I believe is basically the eternal curse of HTML, it evolves and stuff that used to work just fine, end up being replaced with other stuff that work just as fine, until they are again replaced with something. And coders and code need to keep up, which means having to fix things that aren't broken yet.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Antechinus

That will probably do as a simple explanation for those who are determined to not get it. :D

Advertisement: