I have designed a CSS file after exploring it on the google about how to make a css file for produce multiple color in the table data.
I added this CSS file in my php file but it's not working, i don't know why.
Please find my code below.
My Php file
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CHP Search Incidents</title>
<link href="design.css" type="text/css" rel="stylesheet" />
</style>
</head>
<body>
<p>MM/DD/YYYY</p><form action="" method="POST">
<input type=text name=search >
<input type=submit name=submit value=Search>
</form>
</body>
</html>
<?php
$date=date("m/d/Y");
echo "Today Date Is = ";
echo "$date";
include("connection.php");
$table="baltimore";
if(isset($_POST['submit']))
{
$selectcondition = "SELECT * FROM order_details where DATE='".$_POST['search']."'"; //Select Query Which check the INCIDENT ID whether the TURNOVER for the given INCIDENT is exit or not.
$check=mysql_query($selectcondition,$con);
$fetch=mysql_fetch_row($check);
if(!$fetch) //If checklist for the given date is not exit execute if condition
{
echo "<font color='red'>";
echo "<br>";
echo "No Order Found In The Database";
echo "<br>";
echo "</font>";
}
else //if the above condition is flase !
{
$sql= "select * from order_details where DATE='".$_POST['search']."'";
$mydata=mysql_query($sql,$con);
//$fetch_rows=mysql_fetch_row($mydata);
echo "<table width='100%' height='10%' border='1' cellspacing='0'>
<tr bgcolor='#FF6600'>
<th>MODIFIED DATE</th>
<th>Sample ID</th>
<th>ORDER</th>
<th>STATUS</th>
<th>DESCRIPTION</th>
</tr>";
while($records = mysql_fetch_array($mydata))
{
echo "<tr class='mytable'>";
echo "<td>" . $records['TIMESTAMPS'] . " </td>";
echo "<td>" . $records['SAMPLEID']. " </td>";
echo "<td>" . $records['ORDER'] . " </td>";
echo "<td>" . $records['STATUS'] . " </td>";
echo "<td align='center'>";
echo '<textarea name="textarea" cols="100" >'.$records['COMMENTS'].'</textarea><br>';
echo "</td>";
}
echo "</table>";
}
}
?>
MY CSS file
@charset "utf-8";
/* CSS Document */
.mytable {
width:100%;
border-collapse:collapse;
}
.mytable td {
padding::8px;border:#999 1px solid;
}
.myTable tr:nth-child(even) { /*(even) or (2n+0)*/
background: #A4D1FF;
}
.myTable tr:nth-child(odd) { /*(odd) or (2n+1)*/
background: #EAF4FF;
}
Please guys do reply me ASAP.
Thanks alot in advance.