Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

padding not getting applied

Posted on 2011-09-21
8
Medium Priority
?
209 Views
Last Modified: 2012-06-21
-The text inside the table cells is too cramped.  My attempt to add some padding is not working:
-Is it possible to HIDE the 3rd column?
-If a row already has Gray background, I do not want the hover effect to do anything  (since the row is already selected).  Right now if I hover over the row after it has been selected, it undoes the selection coloring.


http://jsfiddle.net/knowlton/E9BZb/5/
0
Comment
Question by:Tom Knowlton
[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
  • 4
  • 3
8 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 1000 total points
ID: 36576495
Qestion 1 : http://jsfiddle.net/E9BZb/12/
$("td:last,th:last", 'table[id*="ShoppingShippingMethods1"] tr').hide()

Open in new window

Question 2 : http://jsfiddle.net/E9BZb/14/
$('tr:gt(0)', 'table[id*="ShoppingShippingMethods1"]').hover(

function() {
    $(this).closest("table").find("tr:gt(0)").css({"background-color": "","color": ""});
    $(this).css({
        "background-color": "blue",
        color: "white"
    });
}, function() {
//    $(this).css({
//        "background-color": "white",
//        color: "black"
//    });
});

Open in new window

0
 
LVL 17

Assisted Solution

by:sonawanekiran
sonawanekiran earned 1000 total points
ID: 36578457
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 36580773
Things are much improved.

But, the header padding is still not correct, and the selected row background still gets erased by the hover effect.

See my screencast.


My current jQuery code is here:

http://jsfiddle.net/knowlton/JZnw8/2/

One of the rows is highlighted, so you can test.

 $('table[id*="ShoppingShippingMethods1"] td').each(function ()
            {
                $(this).css("padding", "5px");
            });

            $('table[id*="ShoppingShippingMethods1"]').children().each(function ()
            {
                $('td').css("border", "1px solid black");
            });

            $('tr:gt(0)', 'table[id*="ShoppingShippingMethods1"]').hover(

                function ()
                {
                    $(this).css({
                        "background-color": "blue",
                        color: "white"
                    });
                }, function ()
                {
                    $(this).css({
                        "background-color": "white",
                        color: "black"
                    });
                });

            $("tr:eq(0)", 'table[id*="ShoppingShippingMethods1"]').css({
                "background-color": "grey",
                "color": "white"
            });

            $("td:last,th:last", 'table[id*="ShoppingShippingMethods1"] tr').hide()

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Author Comment

by:Tom Knowlton
ID: 36580818
0
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36584970
Here is your final version

http://jsfiddle.net/JZnw8/6/
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 36588075
It works on the jsfiddle site for sure.

But unfortunately, it does not work on the actual web page.  I don't know why.
0
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36591337
You need to open another question
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 36599239
thx
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

604 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