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


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):


<input type="checkbox">OEM

<input type="checkbox">Aftermarket


<input type="checkbox">Z Rated

<input type="checkbox">Racing


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?