From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 67c08c27 for ; Tue, 4 Dec 2018 00:33:52 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1gU3LC-0005hU-4B; Tue, 04 Dec 2018 06:33:51 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1gU3LB-0004Tz-De; Tue, 04 Dec 2018 06:33:49 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1gU3LB-0001MX-7g; Tue, 04 Dec 2018 06:33:49 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 44aea0ab; Tue, 4 Dec 2018 06:33:49 +0100 (CET) Date: Tue, 4 Dec 2018 06:33:49 +0100 From: Ingo Schwarze To: Pali Rohar Cc: discuss@mandoc.bsd.lv Subject: Re: Broken tables in HTML output Message-ID: <20181204053349.GI92067@athene.usta.de> References: <20180716110335.uusqzhscwdgp5qaa@pali> <20180716152919.GB85992@athene.usta.de> <20181126212728.GG82448@athene.usta.de> <20181126215826.xepdfaas5fm42ubc@pali> <20181126220133.bf7siow6e5mxahhv@pali> <20181126220516.nrflslyvxufb7xnk@pali> <20181201172057.GD89021@athene.usta.de> <20181203204628.imtj5yh5cnexn27c@pali> X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181203204628.imtj5yh5cnexn27c@pali> User-Agent: Mutt/1.8.0 (2017-02-23) 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