Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
2 posts
|
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 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
2681 posts
|
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? ... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
2 posts
|
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]] 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? If you reply to this email, your message will be added to the discussion below: To start a new topic under Asciidoctor :: Discussion, email [hidden email] -- Dan Allen |Â http://google.com/profiles/dan.j.allen 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. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
1 post
|
In reply to this post by Trebor
Thanks! That was my question and I found the answer in the discussion forum. Iris
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
1 post
|
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!
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
6 posts
|
Good question, why isn't "a" the default?
Did this ever make it into the documentation? |
Free forum by Nabble | Edit this page |