Can you render arbitrary HTML in each YUI datatable cell?

I want to add a split table to a page. It should be 2 rows by 4 columns. Each cell contains a thumbnail and some small links.

We are using YUI elsewhere in the project, so I would like to use Datatable. All the examples I see are tabular data oriented (understandable), but I suspect I can rewrite the HTML of each cell using Javascript. I don't see a callback function that I should use to overwrite cells.

Possible? Or am I trying to hammer in a nail with a screwdriver? If there is an easier way to do this using YUI, I'd love to hear about it.

thank!

+1


source to share


1 answer


jcooper,

To break down a simple grid of image / text elements, I would almost prefer that you use Paginator without using a DataTable. The DataTable is a powerful component, but it works hard to be so many things that you don't need.

Carousel ( http://developer.yahoo.com/yui/carousel/ ), on the other hand, seems to be trying to be exactly what you want. http://developer.yahoo.com/yui/examples/carousel/csl_imagentext.html for example might be a good place to start.



If that's not exactly what you want, you can definitely do it with a DataTable. Just create the chunks of markup you want to use for each cell, store them in an array, and follow the directions for using an array data source and pagination.

Regards, Eric

+3


source







All Articles