Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to set border color in a select in table row

Posted on 2014-10-04
8
Medium Priority
?
122 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 58

Accepted Solution

by:
Julian Hansen earned 2000 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 111

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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…
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…

730 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