Solved

How to set border color in a select in table row

Posted on 2014-10-04
8
112 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 51

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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…

744 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

12 Experts available now in Live!

Get 1:1 Help Now