Left-aligning images in table - not working?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Left-aligning images in table - not working?

wolandscat
I have a tabled defined as follows:

[cols="1,<2,4", options="header"]

The content of that second column is an SVG image (on each row); they always show up horizontally centred down the column instead of left-aligned, no matter what I do. I also tried things like cols="1,<.^2,4"  to no avail. As far as I can tell I am following the documentation.

Is there any known issue with h-alignment of images in tables?

- thomas
Reply | Threaded
Open this post in threaded view
|

Re: Left-aligning images in table - not working?

mojavelinux
Administrator
thomas,

Your syntax is correct. Chances are, it has something to do with the SVG. Perhaps it has built-in padding in the image. I'd have to see an example. I'd probably inspect the page using the DOM inspector to see where the boundaries of the SVG are and whether it really is centered or just touching both sides of the cell.

Cheers,

-Dan

On Mon, Mar 11, 2019 at 6:32 AM wolandscat [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I have a tabled defined as follows:

[cols="1,<2,4", options="header"]

The content of that second column is an SVG image (on each row); they always show up horizontally centred down the column instead of left-aligned, no matter what I do. I also tried things like cols="1,<.^2,4"  to no avail. As far as I can tell I am following the documentation.

Is there any known issue with h-alignment of images in tables?

- thomas


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Left-aligning-images-in-table-not-working-tp6794.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Left-aligning images in table - not working?

wolandscat
Dan,
thanks for looking. The result you can inspect here: https://specifications.openehr.org/releases/PROC/latest/task_planning.html#_event_types
just go past that UML diag - you'll see the table in question.

The .SVGs don't have any extra white space - they are done by draw.io, which cuts right around the visible elements of a drawing.

The sources of that doc are here: https://github.com/openEHR/specifications-PROC/tree/master/docs/task_planning
 and the relevant file is: https://raw.githubusercontent.com/openEHR/specifications-PROC/master/docs/task_planning/master06-model_definition.adoc

search for 'various Event types' to get to where the table is (no live links in Github raw mode :(

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Left-aligning images in table - not working?

1marc1
Thomas,

I just made a screenshot of your first inline image and saved that as a PNG file. I then inserted this in a table of a document that I am currently working on.

Here is the HTML output of that document:
HTML output

Here is the PDF output of that same document:
PDF output

The relevant source of my document is this:

[cols="75,925",frame=topbot,grid=rows,options="header"]
|===
^.<| Item <.<| Description 
^.<| {counter:agenda_item} <.<| image:inline.png[] 

Perhaps this helps in troubleshooting why you get a different result.

Marc.
Reply | Threaded
Open this post in threaded view
|

Re: Left-aligning images in table - not working?

wolandscat
Ah.. I'm an idiot...
Of course I pasted in the image lines using the normal image inclusion for the main doc, which looks like this:

a|image::{diagrams_uri}/event_delay.svg[id=event_delay, align="center"]

so the 'align="center"' was of course overriding the header setting. I was so intent on the header syntax, I just didn't see that until looking at your source code..!

Well, thanks and sorry for the noise folks. Never post late at night :(

- thomas
Reply | Threaded
Open this post in threaded view
|

Re: Left-aligning images in table - not working?

wolandscat
And sorry to imply to anyone that the feature was not working .. I know Dan makes a point of making things work faultlessly, and, in fact they were in this case, just like all the others ....
Reply | Threaded
Open this post in threaded view
|

Re: Left-aligning images in table - not working?

mojavelinux
Administrator
👍

No worries. Glad we could help you talk through the problem!

Cheers,

-Dan

On Tue, Mar 12, 2019 at 11:10 AM wolandscat [via Asciidoctor :: Discussion] <[hidden email]> wrote:
And sorry to imply to anyone that the feature was not working .. I know Dan makes a point of making things work faultlessly, and, in fact they were in this case, just like all the others ....


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Left-aligning-images-in-table-not-working-tp6794p6803.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux