Image in table

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

Image in table

Trebor
I'm trying to embed an image in an html table, but the image is just showing the markup in the final .  Can someone please tell me what I'm doing wrong?

|===
|image::http://www.example.com/myimage.jpg[My Image, 600,160]
|http://www.example.com/quiz/choice=a[The Lion Needs courage]
|http://www.example.com/quiz/choice=b[The Scarecrow needs a brain]
|http://www.example.com/quiz/choice=c[The Tinman Needs a heart]
|===

Thank you,

Trebor
Reply | Threaded
Open this post in threaded view
|

Re: Image in table

mojavelinux
Administrator
Welcome Trebor!

Anytime you want to use AsciiDoc markup in a table cell, you need to set the cell type to "a", short for "asciidoc".

The quickest way to set the cell type is to put the cell specifier immediately before the vertical bar for that cell. In your example, that would look like:

|===
a|image::<a href="http://www.example.com/myimage.jpg[My">http://www.example.com/myimage.jpg[My Image, 600,160]
a|<a href="http://www.example.com/quiz/choice=a[The">http://www.example.com/quiz/choice=a[The Lion Needs courage]
a|<a href="http://www.example.com/quiz/choice=b[The">http://www.example.com/quiz/choice=b[The Scarecrow needs a brain]
a|<a href="http://www.example.com/quiz/choice=c[The">http://www.example.com/quiz/choice=c[The Tinman Needs a heart]
|===

Of course, typing the same cell specifier over and over again is tedious. Instead, you can set the cell type for a whole column using column specifiers. In your example, that would look like:

[cols="1a"]
|===
|image::<a href="http://www.example.com/myimage.jpg[My">http://www.example.com/myimage.jpg[My Image, 600,160]
|<a href="http://www.example.com/quiz/choice=a[The">http://www.example.com/quiz/choice=a[The Lion Needs courage]
|<a href="http://www.example.com/quiz/choice=b[The">http://www.example.com/quiz/choice=b[The Scarecrow needs a brain]
|<a href="http://www.example.com/quiz/choice=c[The">http://www.example.com/quiz/choice=c[The Tinman Needs a heart]
|===

Sarah has been working on filling out the documentation the last few days, focusing in particular cell and column specifiers, so we'll have much clearer information on this topic is taking shape. Here's the current draft: http://asciidoctor.org/docs/user-manual/#columns

Keep the questions coming! This really helps us understand how to make the documentation more relevant.

-Dan


On Tue, Sep 24, 2013 at 11:44 AM, Trebor [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I'm trying to embed an image in an html table, but the image is just showing the markup in the final .  Can someone please tell me what I'm doing wrong?

|===
|image::http://www.example.com/myimage.jpg[My Image, 600,160]
|http://www.example.com/quiz/choice=a[The Lion Needs courage]
|http://www.example.com/quiz/choice=b[The Scarecrow needs a brain]
|http://www.example.com/quiz/choice=c[The Tinman Needs a heart]
|===

Thank you,

Trebor


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



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

RE: Image in table

Trebor

Dan,

 

Thank you for the quick response.  I added the asciidoc directive as you suggested and it worked perfectly, of course!

 

|===

a|image::http://www.example.com/myimage.jpg[My Image, 600,160]

|http:// www.example.com /quiz/choice=a[The Lion Needs courage]

|http:// www.example.com /quiz/choice=b[The Scarecrow needs a brain]

|http:// www.example.com /quiz/choice=c[The Tinman Needs a heart]

|===

 

Note, that I only included the “a” on the image file but not the href tags and they still worked fine.  I guess the next question is, will they continue to work with this syntax in the future, or should I convert them all to a|<a href… format?

 

And thank you for continuing to work on the documentation.  I looked at the link you sent me and even though I now knew what I was looking for based on your example, I can’t say that I would been able to figure it out based solely on the docs.

 

Again, thank you for your quick response.

 

Trebor

 

From: mojavelinux [via Asciidoctor :: Discussion] [mailto:[hidden email]]
Sent: Tuesday, September 24, 2013 11:34 AM
To: Trebor
Subject: Re: Image in table

 

Welcome Trebor!

 

Anytime you want to use AsciiDoc markup in a table cell, you need to set the cell type to "a", short for "asciidoc".

 

The quickest way to set the cell type is to put the cell specifier immediately before the vertical bar for that cell. In your example, that would look like:

 

|===

|===

 

Of course, typing the same cell specifier over and over again is tedious. Instead, you can set the cell type for a whole column using column specifiers. In your example, that would look like:

 

[cols="1a"]

|===

|===

 

Sarah has been working on filling out the documentation the last few days, focusing in particular cell and column specifiers, so we'll have much clearer information on this topic is taking shape. Here's the current draft: http://asciidoctor.org/docs/user-manual/#columns

 

Keep the questions coming! This really helps us understand how to make the documentation more relevant.

 

-Dan

 

On Tue, Sep 24, 2013 at 11:44 AM, Trebor [via Asciidoctor :: Discussion] <[hidden email]> wrote:

I'm trying to embed an image in an html table, but the image is just showing the markup in the final .  Can someone please tell me what I'm doing wrong?

|===
|image::http://www.example.com/myimage.jpg[My Image, 600,160]
|http://www.example.com/quiz/choice=a[The Lion Needs courage]
|http://www.example.com/quiz/choice=b[The Scarecrow needs a brain]
|http://www.example.com/quiz/choice=c[The Tinman Needs a heart]
|===

Thank you,

Trebor


If you reply to this email, your message will be added to the discussion below:

http://discuss.asciidoctor.org/Image-in-table-tp652.html

To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



 

--

 


If you reply to this email, your message will be added to the discussion below:

http://discuss.asciidoctor.org/Image-in-table-tp652p653.html

To unsubscribe from Image in table, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Image in table

IrisR
In reply to this post by Trebor
Thanks! That was my question and I found the answer in the discussion forum. Iris
Reply | Threaded
Open this post in threaded view
|

Re: Image in table

bartvanderwal
In reply to this post by mojavelinux
Thanks, this helped.

But why isn't asciidoc (`a`) the default type of a table column or cell?

You are typing in an .adoc file after all :).
Everyday is another day to learn!