discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Ingo Schwarze <schwarze@usta.de>
Cc: discuss@mandoc.bsd.lv
Subject: Re: Broken tables in HTML output
Date: Mon, 3 Dec 2018 21:46:28 +0100	[thread overview]
Message-ID: <20181203204628.imtj5yh5cnexn27c@pali> (raw)
In-Reply-To: <20181201172057.GD89021@athene.usta.de>

[-- Attachment #1: Type: text/plain, Size: 2942 bytes --]

On Saturday 01 December 2018 18:20:57 Ingo Schwarze wrote:
> > And in all browsers I see another suspicious thing. Vertical lines in
> > the middle of the table are black and horizontal lines are gray or
> > rather dark gray (but not black). Border around whole table is also
> > gray.
> > 
> > Is this intended?
> 
> No, it is not intended, all lines seem black and of equal width to me
> in Firefox 62.0.2 on OpenBSD-current.
> 
> Neither the HTML emitted by mandoc nor mandoc.css makes any statement
> about the color or width of the lines.  That is intentional: neither
> does the tbl(7) input code, and i believe that when styling, it is
> best to only style what you intend to style and leave the rest at
> the default or user settings.
> 
> I don't see why any browser would render any of the lines in gray,
> though, and even less so in two different colors.
> 
>   https://www.w3.org/TR/CSS2/tables.html
> 
> doesn't seem to say anything specific about color, so i'd expect
> 
>   https://www.w3.org/TR/CSS2/colors.html
> 
> to apply, which says:
> 
>   'color'
>     Value:  	<color> | inherit
>     Initial:  	depends on user agent 
> 
> but whatever the initial value for a root element, it should be inherited
> by all children alike, as far as i can see, so the borders should be
> the same color as the text.
> 
> Firing up "Web Developer >> Inspector" in Firefox 62.0.2 and enabling
> "Browser Styles", i do indeed see "border-bottom-color: rgb(0, 0, 0);"
> for the <table> and all its children, as expected.

Hi! I played with colors and seems that browsers do not inherit table
border color to td border color. And by default my chrome and firefox
uses gray color for table (if not specified).

E.g. when you set "table { border-color: yellow; }" and border of
"table" and "tr" elements are yellow, but "td" elements in black.

Following patch "fixes" or rather workaround that problem. It inherits
color also for "td" elements.

Index: mandoc.css
===================================================================
RCS file: /cvs/mandoc/mandoc.css,v
retrieving revision 1.40
diff -u -r1.40 mandoc.css
--- mandoc.css	26 Nov 2018 21:06:02 -0000	1.40
+++ mandoc.css	3 Dec 2018 20:41:19 -0000
@@ -17,7 +17,8 @@
 		border-collapse: collapse; }
 td {		vertical-align: middle;
 		padding-left: 0.2em;
-		padding-right: 0.2em; }
+		padding-right: 0.2em;
+		border-color: inherit; }
 ul, ol, dl {	margin-top: 0em;
 		margin-bottom: 0em; }
 li, dt {	margin-top: 1em; }

With this patch all border colors are now gray (which comes from user
agent style).

What do you think about this patch? In troff/tbl you does not specify
color, but I think that HTML output should have consistent colors -- not
different color for horizontal lines and different for vertical lines.
Just because browsers have different defaults.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2018-12-03 20:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 11:03 Pali Rohár
2018-07-16 15:29 ` Ingo Schwarze
2018-07-16 16:36   ` Pali Rohár
2018-07-16 17:44     ` Ingo Schwarze
2018-11-24 23:15   ` Ingo Schwarze
2018-11-25 19:34   ` Ingo Schwarze
2018-11-25 21:25     ` Ingo Schwarze
2018-11-26  8:53       ` Pali Rohár
2018-11-26 21:27   ` Ingo Schwarze
2018-11-26 21:58     ` Pali Rohár
2018-11-26 22:01       ` Pali Rohár
2018-11-26 22:05         ` Pali Rohár
2018-12-01 17:20           ` Ingo Schwarze
2018-12-01 19:35             ` Pali Rohár
2018-12-03 20:46             ` Pali Rohár [this message]
2018-12-04  5:33               ` Ingo Schwarze
2018-12-03 22:01             ` Pali Rohár
2018-12-03 22:14               ` Ingo Schwarze
2018-12-03 22:20                 ` Pali Rohár
2018-12-03 22:37                   ` Ingo Schwarze
2018-12-04 16:44                     ` Pali Rohár
2018-12-04 18:04                       ` Ingo Schwarze
2019-01-21  9:39                         ` Pali Rohár
2019-01-21 13:16                           ` Ingo Schwarze
2018-11-29  2:15     ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181203204628.imtj5yh5cnexn27c@pali \
    --to=pali.rohar@gmail.com \
    --cc=discuss@mandoc.bsd.lv \
    --cc=schwarze@usta.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).