Solved

How to set border color in a select in table row

Posted on 2014-10-04
8
115 Views
Last Modified: 2014-10-30
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

0
Comment
Question by:breeze351
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40361740
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")
0
 
LVL 53

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 40361823
By select I am assuming you mean the select dropdown. This css should do it

select[name="SIC"] {
    border: 1px solid red;
}

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40362135
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.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 58

Expert Comment

by:Gary
ID: 40362136
Dunno why I thought he meant the cell, maybe he because he talks about every cell gets the border.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40395395
@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.
0
 

Author Closing Comment

by:breeze351
ID: 40414249
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show banners that are blocked by Ad Muncher 10 49
coldfusion grab more the one form field to make an insert 3 30
html input type 3 23
compact pure CSS Read More Toggle 4 24
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now