Generate Complex Html Based On Data Provider

I’m trying to generate some HTML for a form consisting of checkboxes and categories. My database looks like:

Category Name

Wheel OEM

Wheel Aftermarket

Tire Z Rated

Tire Racing

etc…

There are a significant number of records. I’m trying to figure out the best way to generate the html which would look something like this (simplified):


<li>Wheel</li>

<input type="checkbox">OEM

<input type="checkbox">Aftermarket

<li>Tire</li>

<input type="checkbox">Z Rated

<input type="checkbox">Racing

etc...



I’d like to pull all of this data in one query, and then loop through it to generate this HTML. Is there a good way to do this using a DataProvider or something?

Thanks,

Shawn