padding on tabular without vertical rules

12 views
Skip to first unread message

Alex Jordan

unread,
Mar 16, 2023, 2:31:51 AM3/16/23
to prete...@googlegroups.com
I wonder when there is no border between two columns of a tabular, if
we should increase the padding. Consider:
Table 13.17
https://pretextbook.org/examples/sample-article/html/table-calisthenics.html#table-24

And in PDF:
https://pretextbook.org/examples/sample-article/derivatives.pdf#page=80

In the PDF, LaTeX separates the columns on that table fairly well. It
is less clear in HTML.

That is not the best example of the issue because the columns in the
table have cells that vary in width. In this example, it feels like
the last three columns need more separation:
https://spot.pcc.edu/math/orcca/ed2/html/section-comparison-symbols-and-notation-for-intervals.html#wds
Note we would prefer not to use vertical rules to accomplish the separation.

David W. Farmer

unread,
Mar 16, 2023, 8:57:58 AM3/16/23
to prete...@googlegroups.com

Spacing between table columns is complicated, particularly so in PreTeXt
because we already allow the author to micromanage the borders around the
table cells.

Are you wanting a way for the author to say "these particular columns need
some separation" or a way to generally add column spacing in a particular
table, or are you suggesting that in general all tables need more space
(or maybe: when there is not a vertical rule, add more space)?

My questions are really just a way of stalling for time because it is
not going to be easy to figure out how to do this in a way that does
not mess up other tables.
> --
> You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/CA%2BR-jrfBk96JsXqPWxqNQKzEEXn2aW1ancstuYPtBpOLTWGsfg%40mail.gmail.com.
>

Rob Beezer

unread,
Mar 16, 2023, 9:01:51 AM3/16/23
to prete...@googlegroups.com
And vertical rules are actively discouraged.

Best Practice 4.18.1: Vertical Rules in Tables
https://pretextbook.org/doc/guide/html/topic-tabular.html#note-12

Alex Jordan

unread,
Mar 16, 2023, 11:01:35 AM3/16/23
to prete...@googlegroups.com
I was thinking to increase padding on cells that have no left/right
border. There are classes like "r0" that indicate there is no border
to the right. Of course I am not sure what will happen when cells
within the same column sometimes have a left/right border and
sometimes don't.

For my project, it would be OK if ctyling changes are proactive, not
retroactive. For example if we add some class somewhere, and new
styling is based on that. I'm not concerned about ORCCA ed 2; I'm
looking ahead to ed 3.
> --
> You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAyMy5iZWV6ZXI.1678971709%40quikprotect.

Alex Jordan

unread,
Mar 16, 2023, 11:05:15 AM3/16/23
to prete...@googlegroups.com

David W. Farmer

unread,
Mar 17, 2023, 12:14:22 AM3/17/23
to prete...@googlegroups.com

I investigated a bit and made some changes.

It is not possible (meaning, invalid CSS) to make more space
between columns by changing the margin. So, it has to be done
with padding. I think that is actually okay, but I do not have
a way to check every possibility.

I think that for most tables, the additional space is good.
An exception is this table from the sample article:

https://pretextbook.org/examples/sample-article/html/table-calisthenics.html#p-721

That is not a typical case, but if we want to allow it,
then we need a way to put a class on the table to say to
opt-out of the wider spacing.

If there are in-use examples which are harmed by this change,
I can revert and we will come up with a way to selectively
add more space.

I tried to add the minimal amount of extra space to make a difference.
If you think more additional space would be better, please say so.

Note: That ORCCA example is very old: it is on CSS 0.2.
Normally I do not change old CSS, but I did this time.

Note: the extra space is on tr.r0.l0 and th.r0.r0 . There
may be examples with
| a b |
with the a and b in different cells, and not enough space between
a and b. I'll need actual examples before messing with those.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/CA%2BR-jrf5zTpRgKe-iWLs91FHaC4FegeyFV-QTd1HfXjNeeafGA%40mail.gmail.com.
>

Alex Jordan

unread,
Mar 17, 2023, 12:23:17 PM3/17/23
to prete...@googlegroups.com
Thanks David. This reminded me that ORCCA ed2 has its own custom css
file. If any further changes happen I could apply them there instead
of old core CSS. I am more interested in the future, with edition 3.

Would it be good to just increase the padding for *all* cells? If I
look at Table 13.26 in the PDF, the space between "Washington" and
"7,..." is (eyeballing this) about 3 ex. In the HTML, it looks to be
less than 2 ex. So under the assumption that the LaTeX table
typesetting is good, there is reason to change the HTML. At first I
assumed the presence of a vertical bar was enough to separate columns
clearly and maybe that is still true. And I recognize that increasing
padding eats up precious horizontal real estate. But if that is in
short supply for a particular table, the same is true for the PDF
table.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/fb2ad071-715-2049-bd25-367e7a832baf%40aimath.org.

David W. Farmer

unread,
Mar 17, 2023, 12:44:01 PM3/17/23
to prete...@googlegroups.com

I'm comfortable making all the cell padding bigger, if there is a way
for the author to indicate that a particular table should be more
compressed.

Or, if someone can make a case that we should take that option away
from the author because it is always better to have more space
(and more closely match the LaTeX).
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/CA%2BR-jre23ENwXwt6mmbsHeu7x34td27Ha%3DdqnXLsWgncYrikuw%40mail.gmail.com.
>
Reply all
Reply to author
Forward
0 new messages