Tuesday, January 26, 2010

How to use tables to add captions to images in the WYSIWYG editor

If you used the WYSIWYG editor of the CMS to add an image, and want to give that image a caption (some text about the image), it can be a pain to get the text nicely aligned with the image. And using a bunch of spaces is NOT a good idea!

Anyway, here is a quick tutorial on how to do it nicely, by using tables. In this example, we're going to add two pictures next to each other, with their captions below each image in the center.

So, to achieve this, we must first draw a table that will contain the actual pictures, as well as the captions. Since we want our captions to align up nicely next to each other, we're going to have them in their own ROW. So, the images will have a row, and the captions will have a row. Also, each image and caption will have their own CELL - in HTML we may refer to the Cell as the TD or Table Data...

Anyway, lets get our table in first by clicking the Insert/Edit Table button:

 


 This will bring up the Table Properties screen:

 
 
 It might be intimidating at first, but if you look closely, you'll see that is not! Anyway, for this table we want 2 rows and 2 columns. Also, I'm gonna leave the border size on 1, but feel free to make the value 0 if you don't want your table to display its border. Next, I'm making the width 100 PERCENT (not pixels), and the rest I'm leaving as is. The end result for this screen will look like this:

 

 Go ahead and click the OK button at the bottom, which will draw the table in your body copy:



Now, add the images in the first row, and lets center them as well (see here: http://rgcms.blogspot.com/2009/02/adding-image.html if you don't know how to add images yet...):


 Next, simply click in the cells underneath each image, then type in the caption you want, and remember to center the text as well:



 That is how easy it is! As always, remember to save the page. Till next time!

1 comment:

  1. Hello Rudi
    Is there a way that you can add a colored border to an existing table? Thanks :)
    Karen
    (Kaleidoprax)

    ReplyDelete