Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: brynn on April 11, 2025, 11:29:55 PM

Title: how to center a table?
Post by: brynn on April 11, 2025, 11:29:55 PM
Hi Friends,
I know in the past I've been able to wrap a table in the bbcode

[center][/center]
to center a table in a message. But it does not work anymore.

After a bit of searching, I found this not-too-old topic: https://www.simplemachines.org/community/index.php?topic=583803.0

Specifically, posts #18 - #20 seem to provide a solution. Do you all still agree with that as a good solution? Or has a better solution been found since that topic?

If that is a good solution, then I still need a bit of help. I cannot find any file called index.css. Is it in a particular folder? Possibly it lives in a part of the server which I do not have immediate access to. I only have access the forum files on our server. If index.css is on another part of the server, I'll have to ask my co-admin to make the edit.

Thanks for your help  :)

Edit
Sorry, I should say we're using version 2.1.4
Title: Re: how to center a table?
Post by: Diego Andrés on April 12, 2025, 12:12:12 AM
Check this discussion has more relevant info: https://www.simplemachines.org/community/index.php?topic=586445.0

You can apply the fix: https://github.com/SimpleMachines/SMF/pull/7797
It should be fixed in 2.1.5... someday when it's released.
Title: Re: how to center a table?
Post by: brynn on April 12, 2025, 01:22:07 AM
I did see the exact same solution that I found in the other thread. And I can probably accomplish that solution. But I still need to know where to find index.css. Is it in a folder? Or nested within a few folders?

But I'm afraid most of that discussion is over my head. I don't know what to do with the github page. As far as I can understand, this has been fixed, and will be working in a future new version. But I could not understand enough to know what I can do now.

Can you give simple instructions to find the "fix" on the github page, and how to apply it?

Thanks.

Edit
Oh wow..... I clicked on the Files Changed tab (just looking around, without any particular goal), and I think there is the same index.css file I mentioned. And it looks like it's even the same code.

But the forum threads had said to put the code at the end of index.css, while it looks like on that page, it puts the code in a certain place within the file.

Did I find the fix?
Title: Re: how to center a table?
Post by: Aleksi "Lex" Kilpinen on April 12, 2025, 01:26:05 AM
The change is in Themes/default/css/index.css
https://github.com/SimpleMachines/SMF/pull/7797/files
Title: Re: how to center a table?
Post by: brynn on April 12, 2025, 01:32:16 AM
I was editing my last message while you were posting. Did I find the fix?
Title: Re: how to center a table?
Post by: Aleksi "Lex" Kilpinen on April 12, 2025, 01:58:02 AM
Yup, you found it and you should be fine adding it in either location.
Title: Re: how to center a table?
Post by: brynn on April 12, 2025, 01:59:58 AM
Am I correct that I should not type the + signs at the beginning of lines 413, 414 and 415?

Title: Re: how to center a table?
Post by: Aleksi "Lex" Kilpinen on April 12, 2025, 02:18:13 AM
Yes, Github just shows additions with a + and removals with a -.

So the code to add is

.centertext .bbc_table {
margin: auto;
}
Title: Re: how to center a table?
Post by: brynn on April 12, 2025, 03:48:30 AM
Ok, I uploaded the new file. Now for a test....

Hhmm, no change. Looks like it didn't take. Trying again....

Hhmm, I'm not sure what's going wrong. What could I be doing wrong?

I upload the new file, and I click to Overwrite. I get a little message that says the transfer is complete. I look at index.css after the upload, and I see the new code is there. But I'm not getting expected results in the forum.

Maybe I need to restart something? Restart the browser maybe?
Title: Re: how to center a table?
Post by: Aleksi "Lex" Kilpinen on April 12, 2025, 03:53:03 AM
Your browser might have the old css cached, you can try a hard refresh (usually ctrl+f5) to reload everything.
Title: Re: how to center a table?
Post by: brynn on April 12, 2025, 04:19:52 AM
Oh those caches!!

I'm not sure what a hard refresh is. I mean, I see that you wrote Ctrl + f5. But I don't know how a hard refresh is different from a regular refresh. I guess it must ignore the cache?

But it's getting very late here, so I'm going to sign off for tonight. Then I'll check on it tomorrow. Who knows? If nothing else, sleep can't hurt either!

I'll let you all know what happens.

Thank you all so much for your very kind patience. I appreciate it so very much!  :laugh:
Title: Re: how to center a table?
Post by: Aleksi "Lex" Kilpinen on April 12, 2025, 04:33:53 AM
Yes, exactly a hard refresh is just a reload that ignores cache.
Title: Re: how to center a table?
Post by: brynn on April 17, 2025, 10:29:46 AM
Ok, I'm finally back.

So the computer has been restarted, and I also tried Ctrl + f5, just in case. But the center tags are still not centering a table.

It looks like we have 6 mods installed. Could one of them be somehow blocking the new codes from working?


Edit
OH!! I'm happy to say Nevermind!! And we can mark this problem solved!

I decided to try actually clearing my cache, just to make sure. And now the table is centered!

Thank you all again for your help and patience!