The nice thing about CSS is that you can apply almost any style to almost any element, I’m adding almost, but I’m quite certain that any style can be applied to any element… you can name these elements or you can apply the styles to all matching elements, for example you can name your table
<table id="mytable"> </table>
will create a table named mytable then in your CSS you could style it with
#mytable { width: 400px; }
or you could apply styling to all of the tables on your site with
table { width:400px; }
to style sub elements such as td, etc you could use
#mytable td { color: blue; }
or apply that to all td element using that style sheet with
td { color: blue; }
It is beneficial to get some education in CSS so that you can really understand it’s power, w3schools is a good place for free education about that and other similar topics.
Also a comment about PHP sometimes it is easier to type your code and even read it later to close the PHP tag for the HTML so instead of typing:
<?php
$x = "This is my table";
if ($x) {
print("<table id=\\"mytable\\">");
print("<tr><td>");
print($x);
print("</td></tr>");
print("</table>");
}
?>
It might be easier to type, read and fix later:
<?php
$x = "This is my table";
if ($x) { ?>
<table id="mytable">
<tr>
<td>
<?php
print($x);
?>
</td>
</tr>
</table>
<?php
}
?>
On a final note, is there a reason why you use print instead of echo? Same results but less typing: