/colored-table-cell-on-select.htm Secret
Created
December 24, 2019 20:31
Colored Table Cell On Select
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="post"> | |
<select name="cell" size="1"> | |
<option></option> | |
<option value="a">A</option> | |
<option value="b">B</option> | |
<option value="c">C</option> | |
</select> | |
<input name="submit" type="submit" value="Submit"> | |
</form> | |
<style type="text/css"> | |
<!-- | |
table td { | |
border: 1px solid; | |
} | |
<?php | |
if (isset($_POST['cell'])) | |
{ | |
echo "td.{$_POST['cell']} {background:yellow;}"; | |
} | |
?> | |
--> | |
</style> | |
<table> | |
<tr> | |
<td class="a">Cell A</td> | |
<td class="b">Cell B</td> | |
<td class="c">Cell C</td> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment