-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find a good workflow for tables #55
Comments
Oh, I should also mention that OBFL/Dotify supports defining custom fallback mechanisms for tables. If there are certain situations where table layouts could be selected without human interaction, we can exploit that. |
@bertfrees , I had a discussion with @mixa72 yesterday. The following are my notes:
|
Thanks. Makes sense. |
See also #56. |
Each style is associated with its own class: table-linearized, table-matrix and table-matrix-transposed. The linearized style is used for tables without a class attribute. Tables with a class not equal to the 3 predefined ones have no default style. see issue sbsdev/pipeline-mod-sbs#55
Each style is associated with its own class: table-linearized, table-matrix and table-matrix-transposed. The linearized style is used for tables without a class attribute. Tables with a class not equal to the 3 predefined ones have no default style. see issue #55
Hi @mixa72. Have you looked at this? |
When I try to produce a table with class="table-matrix-transposed", the pipeline hangs. What are the class names to be used: table-linearized, table-matrix and table-matrix-transposed? |
Yes, those are the classes. Could you send me the input file that is causing the Pipeline to hang? |
@mixa72 Thanks for the input files. It appears the table has too many rows to fit on the page. The same would happen if you had a table without the class "table-matrix-transposed" but with too many columns. |
All of our table classes seem to render correctly:
The first table has the class "table-linearized", the second "table-matrix", the third "table-matrix-transposed" and the last one has an individual style with leaders.
|
The margin thing was a bug. I've fixed it. The underlining thing is not a bug. It's just how tables are formatted. If the minimal total width of the table is lower than the available page width, the columns are made slightly wider. The underlinings are as wide as the columns. How much space the columns take can be controlled with the |
OK. That also explains why table 2 has shorter underlinings than table 3: it takes nearly the whole page width. I suggest that we set |
Done. |
Currently the default CSS handles all tables the same. Whenever you want to give a table a different formatting, you need to apply some custom CSS to it, for example by giving it a certain class. Because the default CSS is applied to all tables, it needs to be reset first, otherwise it may give undesired results in combination with your custom CSS. I've added a convenience "extend-only" rule to do this (see default.scss#L808):
It is used like this:
This method could work, however it does complicate things a little. A somewhat simpler alternative could be to apply the default CSS only on tables without a class attribute:
This means that whenever you add a class to a table, the default style is cancelled automatically, so the
@extend %table-reset;
line isn't needed anymore. Of course the downside is that when the table has a class for a different reason (e.g. because you got it that way from the publisher), it won't have a default style either.So now we have a way to style individual tables, but it might not give us the most efficient workflow. We could for example consider doing something similar as we are doing now with dtbook2sbsform, namely create 3 different versions of a table, so that you can determine the best layout immediately without having to try them all manually. It could work like this: every table without a class is copied a number of times and every table gets a different class (the copies as well as the original). Every class corresponds to a different style in the default CSS.
After the first pass, all versions of the tables end up in the resulting PEF. Then you go through the input document and add to each table the class that corresponds to the preferred layout. All tables need a class otherwise they will be duplicated again in the second pass. (Or possibly we can add an option to disable the duplication, and instead give tables without a class attribute a default style.) This workflow could of course be combined with custom table classes as well.
@mixa72 and @egli: what do you guys think?
The text was updated successfully, but these errors were encountered: