Link to home
Start Free TrialLog in
Avatar of breeze351
breeze351

asked on

How to set border color in a select in table row

I have a table with one row that has a "select".  I want to change the border of just the "select".  Every solution that I've tried changes the border of the entire row.

Here's the code that I'm using:
<td>
	            <div style="border: 1px solid #ff0000;">
				<select name = "SIC" width = "20%"> 
				<?php	
					//Iterate through Siccode File and populate drop down
					$SqlString1 = "SELECT * FROM siccoder";
					$Siccode_Data = mysql_query($SqlString1,$conn);
					while ($ROW2 = Mysql_fetch_assoc($Siccode_Data, MYSQL_BOTH))
					{
						echo "<option value = \"";
						echo $ROW2['SIC'];
						echo "\"";
						if ($ROW2['SIC'] == $ROW['SICCODE'])
					 	{
							echo " selected";
						}
						echo ">";
						echo $ROW2['DESCR'];
						echo "</option>";
			    	}
 				?>
                </select>
                </div>
			</td>

Open in new window

Avatar of Gary
Gary
Flag of Ireland image

You would need to give the TD a class or ID to target it else use some jquery

$("[name=SIC]").closest("td").css("border","1px solid black")
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No points for this, but please get off the MySQL extension.  The official deprecation and removal notice is by now years old, and your scripts will have to be changed.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html
Dunno why I thought he meant the cell, maybe he because he talks about every cell gets the border.
@breeze351
Care to explain your selected answer - it has nothing to do with your question and was only Ray giving some advice about your db connections.
Avatar of breeze351
breeze351

ASKER

Thanks