duta
asked on
How to embed CSS in PHP?
Hi experts:
I have a HTML CSS code code (as seen below) embedded in PHP.
But it is not working.
Can you kindly give me a tip?
Thanks!
I have a HTML CSS code code (as seen below) embedded in PHP.
But it is not working.
Can you kindly give me a tip?
Thanks!
<? php
'<style type="text/css">
table.myTable td
{
border: solid 1px black;
}
table.myTable th
{
border: solid 1px black;
background-color:silver;
}
</style>'
echo '<table class = "myTable"><tr><th> Name</th><th> Email</th></tr>';
while (!$result->EOF)
{
echo '<tr>' .
'<td>' . $result -> fields ['Name']. '</td>' .
'<td>' . $result -> fields ['Email'] . '</td>' .
'</tr>';
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much for your kind, prompt tip.
By the way, I inserted "Echo" command. Still I got an error message from
the bottom line of the code (in Code Snippet box):
// Errors comes from the line below
echo "<table class = 'myTable'><tr><th> Name</th><th> Email</th></tr>";
By the way, I inserted "Echo" command. Still I got an error message from
the bottom line of the code (in Code Snippet box):
// Errors comes from the line below
echo "<table class = 'myTable'><tr><th> Name</th><th> Email</th></tr>";
<?php
function printEntries($result)
{
echo
"<style type='text/css'>
table.myTable td
{
border: solid 1px black;
}
table.myTable th
{
border: solid 1px black;
background-color:silver;
}
</style>"
echo "<table class = 'myTable'><tr><th> Name</th><th> Email</th></tr>";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you have missed, ;
</style>";
ASKER
Thank you very much!
Open in new window