I got an html table, and I use some loop to get some data, this data is displaying this way:
Data
... next loop
Using the modulo (%) operator is always a great solution for the problem you have above. Since you didn't provide details about the implementation language, I've taken the liberty to provide you with a php example of how it's done.
tag after 3 outputs of the tags
$data = "Data"; // Placeholder of the data
echo "";
for($i = 1; $i <= 10; $i++)
{
echo "{$data} ";
if ($i % 3 == 0)
echo " "; // Close and reopen the tag
}
echo " ";
?>