[Solved] View Table Layout Question |
On my view I have a table which has foreach in side a foreach.
As you can see I also have in the tbody. TR inside a TR if you understand. My question is is it safe and OK to place a tr inside another tr like I have done Quote:<div class="panel-body">
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
No, it is definitely not ok to do that.
If you do this the browser will do the best it can to interpret your HTML, but you will get wildly different interpretations of your markup errors on different browsers. You can embed a table in a table cell, but you would need the full table markup.
(09-22-2015, 01:06 AM)PaulD Wrote: No, it is definitely not ok to do that. Do you have any examples? I have attached image to what it looks like now.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
try something like this and make your own css rule on the tr.category class and its childs
PHP Code: <?php foreach($categories as $category) : ?>
(09-22-2015, 02:23 AM)sintakonte Wrote: try something like this and make your own css rule on the tr.category class and its childs Ok Thank you. And I see you use endforeach but I use <?php } ?> and end of it most of the times what's better?
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
you can use both
i use it in cases where i have nested loops because its more clear in my opinion i think in your case its debatable to use more than one view for simplification for example: your main view PHP Code: <div class="panel-body"> the category-list-view.php should look like PHP Code: <tr> it looks much more clearer and you shifted away from your nested foreach approach in one view
(09-22-2015, 02:50 AM)sintakonte Wrote: you can use both Thanks will keep this in mind thanks
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |