nested table in php
Moderator: General Moderators
nested table in php
Is there a way I can nest a table into my php code..? for example I have a whole bunch of form variables brought into php and I want to be able to print them in a table , so that I can align them and font them and make them all fancy..
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: nested table in php
Not sure what you mean "nest"? You can do either of these with PHP:
Code: Select all
<?php
echo "<table>
<tr>
<td>$var1</td>
<td>$var2</td>
</tr>
</table>";
?>
<table>
<tr>
<td><?php echo $var1; ?></td>
<td><?php echo $var2; ?></td>
</tr>
</table>(#10850)
Re: nested table in php
Thank you , this is what I'm looking for.. but what can I insert if I want it to look like this:
The contents of variable1 : Var1
Variable2 is made up of : Var2
Sort of like a 2x2 table?
And is there a way I can make Var1 have a font and Var2 a different font? Thank you.
The contents of variable1 : Var1
Variable2 is made up of : Var2
Sort of like a 2x2 table?
And is there a way I can make Var1 have a font and Var2 a different font? Thank you.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: nested table in php
You would put things like font attributes into the HTML. Create a style sheet with classes for the table cells. It really has nothing to do with PHP. Look around the web for examples of controlling the font in HTML.
(#10850)