• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

alignment of table

Enthusiast ,
Dec 17, 2022 Dec 17, 2022

Copy link to clipboard

Copied

Hi,

 

There is a table in Id.

 

I exported it to EPUB.

The table looks OK on iPhone (Books app).

There is an alignment issue on Mac (Books app).

 

Do you have any comment on it?

 

Hosun

IdIdBooks app (iPhone)Books app (iPhone)Books app (Mac)Books app (Mac)

TOPICS
Feature request , How to

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 15 Correct answers

Community Expert , Dec 18, 2022 Dec 18, 2022

Most ePub creators suggest that in a Reflowable ePub you should use an image for tables.

Votes

Translate

Translate
Community Expert , Dec 18, 2022 Dec 18, 2022

Have a look at Object Export Options.

Screenshot 2022-12-18 at 21.20.29.png

Votes

Translate

Translate
Community Expert , Dec 19, 2022 Dec 19, 2022

Using an image is a last-ditch option for tables with a layout too fussy or complex to let an e-book reader manage, like this —

JamesGiffordNitroPress_0-1671465507431.png

 

Most simple, linear tables (like the OP's) can be exported successfully. The trick is to focus on the actual exported table and not the one in the ID doc; this is one of those cases where a somewhat "distorted" layout is needed to lead the reader to a clean presentation. (The faults lie mostly in ID's refusal to export HTML padding, so you either have to reformat at

...

Votes

Translate

Translate
Community Expert , Dec 20, 2022 Dec 20, 2022

Try this:

 

Take the table out of a text box. It adds nothing in the way of control. Quick testing didn't show any useful effects from applying Object Export parameters.

 

As I suspected, nothing done within ID will force the table to expand to full width. My notes were incomplete but leaned this way; I've just proven it to my satisfaction. What you can do is apply cell styles with spacing to get a more pleasing layout — and as noted above, what you get/see in ID might be very odd or distorted t

...

Votes

Translate

Translate
Community Expert , Dec 20, 2022 Dec 20, 2022

You can make the CSS command as specfic as you like. Just "table" as the style will affect all tables. If you wanted it to affect only one ID style of table, give the style a name — Color Table — and then change the CSS style to:

table.Color-Table { width:100%; }

 

You can, of course, have any number of these style-definition pairs. You shouldn't need to open or edit the EPUB after export; the CSS style is applied by including it in the EPUB export "Additional CSS" list.

 

You could also make th

...

Votes

Translate

Translate
Community Expert , Dec 20, 2022 Dec 20, 2022

Maybe I wasn't clear; I thought we'd gone through a CSS mod before.

 

Take the table out of the text frame. It adds nothing. Put the table right after the paragraph you want it to follow; it's just "fancy text" and will stay there without having to be anchored. (I would also take the caption out of its text box, which does nothng; just make it a paragraph that is formatted and spaced appropriately.)

 

With a text editor like Notepad, create a file in the same folder called (for example) grimm.cs

...

Votes

Translate

Translate
Community Expert , Dec 20, 2022 Dec 20, 2022

There are two things I'm suggesting, here. One is optional.

 

You have your table in a text frame. This is unnecessary and while it may not affect the alignment issue, it's complicating things. Select the table, cut it, and paste it back into the text flow, outside of that text frame. Delete the text frame.

 

That won't fix anything by itself but it removes a layer of document complexity that can make other fixes harder or less predictable.

 

When you have the table as just part of the text flow

...

Votes

Translate

Translate
Community Expert , Dec 21, 2022 Dec 21, 2022

To start with, it looks as if you still have the table in a text frame. It doesn't need to be, and that makes things more complicated. So what follows may not work unless additional styling/CSS is applied to that text box.

 

As long as the table is just part of the text fow, this is a case where what you do in ID will happen in EPUB — center the table in the document, and it will export centered with no CSS override necessary.

 

Use the arrow keys to select the start of the table (you will get a

...

Votes

Translate

Translate
Community Expert , Dec 21, 2022 Dec 21, 2022

Tables will attach in different ways to adjacent paragraphs, including just "running on" from prior paragraph text or into following text. You want to make sure they are on a paragraph of their own:

 

[Paragraph in BODY style]¶

[Paragraph in centered style, holding Table]¶

[Paragraph in BODY or some other style]¶

 

That is, with hidden characters on, you should see a pilcrow at the end of each of these three paragraphs, the table included.

 

Votes

Translate

Translate
Community Expert , Dec 21, 2022 Dec 21, 2022

Apply whatever style you want or need to each of those three elements. They should be completely independent with the connection between the table and the following paragraph broken by the paragraph return.

 

I assume you want the regular body style on the last paragraph; apply it, and it should leave the table (and its paragraph) centered. That formatting should all export to EPUB without needing any CSS changes other than the width: statement.

 

Votes

Translate

Translate
Community Expert , Dec 22, 2022 Dec 22, 2022

I have never seen that error.

 

Try renaming the second instance — and always use meaningful paragraph style names that give some context. In this case, 'body paragraph' and 'body paragraph centered' would be more intuitive and might elimnate this odd collision.

 

You can also look at the global paragraph styles export list (click the 'hamburger' icon in the Paragraph Styles list, then select Edit All Export Tags). In that list, make sure every style, especially these two, have a unique export n

...

Votes

Translate

Translate
Community Expert , Dec 22, 2022 Dec 22, 2022

You can assign any export names to them; it does not affect the InDesign styles. Besides just general management, this feature is VERY useful when you want to maintain "sensible" InDesign style names but export more compact, HTML/CSS-friendly versions to the EPUB.

 

Votes

Translate

Translate
Community Expert , Dec 22, 2022 Dec 22, 2022

Tables get tricky because table and cell styles overlap in a hierarchy that's not always predictable.

 

Try creating a cell style with a white background and "none" or 0 for borders. If that doesn't work, apply thin white borders. One or the other should produce that "missing" cell appearance.

 

Votes

Translate

Translate
Community Expert , Dec 24, 2022 Dec 24, 2022

I don't see a problem in the latter example, unless that is with the white border.

 

I can't find my detail notes on tables so I may just spend some of this long weekend messing around with a redo and some things I didn't evaluate before.

 

Something you might try is adding 'border-collapse: separate;' to your table definition, to see if that affects the various adjoining borders in a positive or negative way. I'm pretty sure 'collapse' is the default value for both ID export and EPUB interpreta

...

Votes

Translate

Translate
Community Expert , Dec 24, 2022 Dec 24, 2022

And here's some interesting findings. I find that both border-collapse and empty-cells work in EPUB (Calibre/Thorium):

JamesGiffordNitroPress_0-1671922358777.png

This is a table with borders defined red, cell borders defined blue, collapse set to 'separated' and two cells left empty.

 

Kindle does not honor empty-cells but does follow everything else. Making your borders all 0/none/white and using these two commands might allow you to style the table the way you want, with slight white separation between the colored cells for definition

...

Votes

Translate

Translate
Community Expert ,
Dec 24, 2022 Dec 24, 2022

Copy link to clipboard

Copied

And here's some interesting findings. I find that both border-collapse and empty-cells work in EPUB (Calibre/Thorium):

JamesGiffordNitroPress_0-1671922358777.png

This is a table with borders defined red, cell borders defined blue, collapse set to 'separated' and two cells left empty.

 

Kindle does not honor empty-cells but does follow everything else. Making your borders all 0/none/white and using these two commands might allow you to style the table the way you want, with slight white separation between the colored cells for definition.

 


╟ Word & InDesign to Kindle & EPUB: a Guide to Pro Results (Amazon) ╢

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 25, 2022 Dec 25, 2022

Copy link to clipboard

Copied

Step 1. I gave 3px and black to the borders of Greg Maddux.

Step 2. The topleft corner of the cell is a clean-cut.

Step 3. I gave 0px and white to all the borders of the table. (border-collapse:separate, border-spacing:1px)

Step 4. It looks better than black border.

 

Hosun

 

Step 1Step 1Step 2Step 2Step 3Step 3Step 4-1. Books app (Mac)Step 4-1. Books app (Mac)Step 4-2 Books app (iPhone)Step 4-2 Books app (iPhone)

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

Screenshot 1 (Table 2). I took out caption and table from the text boxes and place them in the text flow to make the live text.

Screenshot 2 (Photo 4). I took out caption. Which one would I choose in Size of the Object Export Options? (in keeping consistency of Table 2 and Photo 4)

 

Hosun

 

Screenshot 1 (Table 2)Screenshot 1 (Table 2)Screenshot 2 (Photo 4)Screenshot 2 (Photo 4)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

LATEST

I tried options in Size.

 

Default and Relative to Text Flow keep consistency in Photo 4 and Table 2.

 

I see there is no difference between Default and Relative to Text Flow.

Am I correct?

 

Hosun

 

Size: DefaultSize: DefaultSize: Default (Books app on Mac)Size: Default (Books app on Mac)Size: Relative to Text FlowSize: Relative to Text FlowSize: Relative to Text Flow (Books app on Mac)Size: Relative to Text Flow (Books app on Mac)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines