Re: Weird table alignment override in website docs style

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-www(at)lists(dot)postgresql(dot)org
Subject: Re: Weird table alignment override in website docs style
Date: 2020-04-14 22:17:14
Message-ID: CAKFQuwbuu8NhhC3DiWxUPCj9=r6b6O=46YaT=UpV7CiHqpCMpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Tue, Apr 14, 2020 at 2:53 PM Jonathan S. Katz <jkatz(at)postgresql(dot)org>
wrote:

> On 4/14/20 5:40 PM, Tom Lane wrote:
> > "Jonathan S. Katz" <jkatz(at)postgresql(dot)org> writes:
> >> The fix is now live:
> >> https://www.postgresql.org/docs/devel/functions-enum.html
> >
> > Hm, looking at
> >
> > https://www.postgresql.org/docs/devel/functions-enum.html
> >
> > it seems like it's now handling valign=middle for the "Function"
> > header, but it's still ignoring align=center for all the headers.
>
> Oops I missed that, sorry.
>
> Doing some research, and from what I recall, align/valign as HTML
> properties are technically no longer supported in HTML5 -- you are
> supposed to handle this with CSS (text-align & vertical-align
> respectively)[1]. The main reason it still works is that browsers still
> support that backwards compatibility.
>
> I do have a fix on my local that accounts for this using CSS attribute
> selectors to check for that value and then apply it as CSS and it is
> safe across browsers. I do wonder if it's more prudent to have a class
> on it that I can check for?
>

I would suggest adding a class to the table element designating this as a
"v12" style table. Then something like the following would (untested) just
work:

table.v12 > thead > tr > th {
text-align: center,
vertical-align: middle
}

Adding semantic classes to the other elements, namely the <th>, would work
too and allow for more precision and less potential for conflicts.

I do think (though not really knowing the existing state) that regardless
of the precision for the sub-table selectors that these tables should
probably have new css rules created for them and those rules limited to
applying only to properly classed tables. Being as they should be more
selective than existing table related selectors the newly added rules
should then also take precedence. And newly added rules here won't impact
the body of existing tables that we have - not all of which I would presume
are going to change.

David J.

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Jonathan S. Katz 2020-04-14 22:29:19 Re: Weird table alignment override in website docs style
Previous Message Tom Lane 2020-04-14 22:16:35 Re: Weird table alignment override in website docs style