Solved

padding not getting applied

Posted on 2011-09-21
8
194 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:knowlton
  • 4
  • 3
8 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 250 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 250 total points
ID: 36578457
0
 
LVL 5

Author Comment

by: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
 
LVL 5

Author Comment

by:knowlton
ID: 36580818
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36584970
Here is your final version

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

Author Comment

by: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:knowlton
ID: 36599239
thx
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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.
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)

759 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

20 Experts available now in Live!

Get 1:1 Help Now