I’m currently working on a dynamic table below:
echo '<table border=1>';
echo '<tr align="center" width="140"><td>column 1 →
<br />↓ column 2</td>';
echo "<td width='70'>{$c1}</td>";
echo "<td width='70'>{$c2}</td>";
echo "<td width='70'>{$c3}</td>";
echo "<td width='70'>{$c4}</td>";
echo "<td width='70'>{$c5}</td>";
echo '</tr>';
for ($i = $min; $i <= $max; $i+=5) {
echo '<tr align="center">';
echo '<td>'.$i.'</td>
<td>'.$c1*$i.'</td>
<td>'.$c2*$i.'</td>
<td>'.$c3*$i.'</td>
<td>'.$c4*$i.'</td>
<td>'.$c5*$i.'</td>';
echo '</tr>';
}
echo '</table>';
I was just wondering if there was a more effective less time-consuming method of generating it?
The table is created from the following inputs
min, max, c1, c2, c3, c4, c5
where if for example:
min=30, max=45, c1=5, c2=10, c3=15, c4=20, c5=25
the table might look something like:

Thanks in advance!
I would take a bit different approach. At first I don’t like the idea of having calculations (even simple ones) and view/result/html code mixed. So I would separate those tasks. Normally in most bigger applications this kind of table generation would not even be possible (like MVC frameworks) or is at least not preferred. Also I moved out the styling of the table.
Next to that I don’t like the numbered values, a list of data looks like an array. I have not enough meta information whether that’s correct so I just made it an array since it looks to make sense. The amount of columns is flexible now also.
View code (so PHP) I always try to keep as compact as possible but readable. Mostly simple code, not many loops, not many different functions just basics. So not a for loop with a specific step because it is not relevant. The view part should just show the data as it gets the data.
Hope parts are useful for your project. Hope there are some. I like to write out quite lots of indents / tabs / newlines but you can always style the HTML as you want off course. Next to that I also always add table head, body and scopes which is different from your question but gives the same output in terms of layout off course as asked.