Page 1 of 1

[SOLVED] Change table's CSS to allow alignment override

Posted: Thu Oct 31, 2024 3:52 am
by vadcx
EDIT: See the second post, it was an initial mistake in table formatting.

https://en.wikipedia.org/wiki/Wikipedia ... formatting shows how you can specify custom CSS for tables.

On Recycler's page its' outputs are hard to read because they are centered. I have attempted a custom style and it turned out to not work: https://wiki.factorio.com/index.php?tit ... did=203961 ... I only submitted the change because I fooled myself by getting it to work after I modified the page styles in DevTools.

The following would preserve the old styling by default and allow such overrides to work:

https://wiki.factorio.com/load.php?lang ... vectordark

Code: Select all

.wikitable > tr > th, .wikitable > * > tr > th {
	background-color: #eaecf0;
	text-align: inherit; /* --> changed from center to be controlled by .wikitable or in-page user style */
}
Add:

Code: Select all

.wikitable {
/* makes sure table headings remain centered; and to have an effect on inherit IF not overriden by in-page user style */
	text-align: center;
}
When you carry out these modifications in DevTools, my "text-align: left" begins to work (!important isn't needed) yet headings remain centered as expected.

It's possible I'm doing something wrong or such level of detail is not desired :roll:

Re: Change table's CSS to allow alignment override

Posted: Thu Oct 31, 2024 12:51 pm
by vadcx
Nevermind, Untitled7 fixed it :lol: https://wiki.factorio.com/index.php?tit ... did=203961

The table data rows were previously defined as "!" aka table headers. He changed it to "|" which stand for table data rows. https://www.mediawiki.org/wiki/Help:Tables I will change the thread title accordingly.

Re: Change table's CSS to allow alignment override

Posted: Thu Oct 31, 2024 7:32 pm
by untitled7
vadcx wrote: Thu Oct 31, 2024 12:51 pm Nevermind, Untitled7 fixed it :lol: https://wiki.factorio.com/index.php?tit ... did=203961

The table data rows were previously defined as "!" aka table headers. He changed it to "|" which stand for table data rows. https://www.mediawiki.org/wiki/Help:Tables I will change the thread title accordingly.
yeah, styling in the opener of the table apply generally, but they get overwritten by the more specific selectors
I altered that table further now, to not be a table in a table