I have quite a few tables on my site, each of which contains two columns: A title and a value from the SQL database. I am currently putting the data in the table using:
<table>
<tr>
<td class = "item">House</td>
<td class = "req"><?php $row_buyerdetails['tod_house']; ?></td>
</tr>
<tr>
<td class = "item">Bungalow</td>
<td class = "req"><?php $row_buyerdetails['tod_bung']; ?></td>
</tr>
</table>
This seems like a long winded way of creating the table (especially as I will have alot more rows than this and quite a few separate tables). Also if I want to make a change to the class name for example, Id have to change every row in every table! There must be a way of putting the 'item' and the 'req' pairs in an array, and then creating a loop which makes the table, populates with the data from the database and assigns the classes? Im new to PHP so cant work out how to do this!
EDIT
The table code above will create the following table:

The tables layout is how I want it. However, i dont want to type out every line of code, I want to put the type of dwelling (with a class of 'item') and the result from the database (with a class of 'req') in an array, and then loop through this array to create the table rather than typing out every <tr> and <td> for every row and every table. I just dont know the technique in PHP to loop through and create the different tags, insert the data into them, and assign the different <td> a class each!