discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Pali Rohar <pali.rohar@gmail.com>
Cc: discuss@mandoc.bsd.lv
Subject: Re: Broken tables in HTML output
Date: Tue, 4 Dec 2018 06:33:49 +0100	[thread overview]
Message-ID: <20181204053349.GI92067@athene.usta.de> (raw)
In-Reply-To: <20181203204628.imtj5yh5cnexn27c@pali>

Hi Pali,

Pali Rohar wrote on Mon, Dec 03, 2018 at 09:46:28PM +0100:

> Hi! I played with colors and seems that browsers do not inherit table
> border color to td border color.

Well, inheritance always works, but it can be overridden, and it
appears that some browsers override border-color on varying levels
of the table element hierarchy without overriding the default for
the levels above.

> 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.

That doesn't match what my Firefox 62.0.2 does: it draws "table"
borders yellow but "tr" and "td" borders black.

[...]
> 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.

I think that is reasonable.  CSS is the place where styles are
supposed to be defined, so adding a few additional attributes is OK
when there are good reasons, as opposed to adding style= attributes
to the HTML code.

I think "browsers have inconsistent defaults and we want consistent
layout" is a good enough reasons to add a few CSS attributes, even
though "browsers have bugs" does not look like a good reason to
encumber the HTML code with spurious "style=" attributes.

So i committed the following patch.

Yours,
  Ingo


Log Message:
-----------
Make sure all borders in a table are drawn in the same color.
Required because browsers tend to have inconsistent defaults:
For example, Firefox 62.0.2 sets border-color for tbody, but not for table,
and Pali Rohar reports that Chrome set it for td, but not for tr or tbody.
The td part is from Pali Rohar, the tbody and tr parts from me.

Modified Files:
--------------
    mandoc:
        mandoc.css

Revision Data
-------------
Index: mandoc.css
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc.css,v
retrieving revision 1.40
retrieving revision 1.41
diff -Lmandoc.css -Lmandoc.css -u -p -r1.40 -r1.41
--- mandoc.css
+++ mandoc.css
@@ -15,9 +15,14 @@ body {		font-family: Helvetica,Arial,san
 table {		margin-top: 0em;
 		margin-bottom: 0em;
 		border-collapse: collapse; }
+/* Some browsers set border-color in a browser style for tbody,
+ * but not for table, resulting in inconsistent border styling. */
+tbody {		border-color: inherit; }
+tr {		border-color: inherit; }
 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; }
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

  reply	other threads:[~2018-12-04  5:33 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
2018-12-04  5:33               ` Ingo Schwarze [this message]
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=20181204053349.GI92067@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mandoc.bsd.lv \
    --cc=pali.rohar@gmail.com \
    /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).