With jQuery you can:
- find all items in wanna-have-geen-border column
- give them all dotted green left
- give them all the exact lower green border
- use: last to remove unwanted bottom border from last element
You can find all the rows in this column by doing something like:
$(td[class*="greenBorder"]).addClass("green_borders"); $(td[class*="greenBorder"]).last().css('border-bottom','')
Note that I'm saying something like that because they are not very good with jQuery and do not have the correct syntax / understanding of how the selector is used. But I saw examples where similar things are done. You can find tons of examples of this site or read the source documentation (which is inadequate, imho).
Ok, I did this:
<!DOCTYPE HTML> <html lang="en"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> <title>Green Border</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <style type="text/css"> .geniusPicks {} .geniusPicks table {width:100%; font-size:12px;} .geniusPicks table tr#picksHeading {border:0px solid; height:30px;} .geniusPicks table tr#picksHeading th {background:darkRed; color:white; font-weight:bold;} .geniusPicks table tr.pickHeading {border:0px solid;} .geniusPicks table tr.pickHeading td {background:red; padding-left:10px;} .geniusPicks table tr.pickConsensusBody td {border:1px solid; background:grey;} .geniusPicks table tr.pickBody td {border:1px solid;} .bigGap td {height:19px;} .smallGap td {height:10px;} .geniusPicks table th, .geniusPicks table th+th+th+th+th+th, .geniusPicks table .pickHeading+tr td, .geniusPicks table .pickHeading+tr td+td+td+td+td+td+td {text-align:center;} .geniusPicks table th+th+th, .geniusPicks table .pickHeading+tr td+td+td {text-align:left;} .borderLeftRadius { border-radius:15px 0 0 0; -moz-border-radius:15px 0 0 0; -webkit-border-radius:15px 0 0 0; -khtml-border-radius:15px 0 0 0; } .borderRightRadius { border-radius:0 15px 0 0; -moz-border-radius:0 15px 0 0; -webkit-border-radius:0 15px 0 0; -khtml-border-radius:0 15px 0 0; } </style> <script type="text/javascript"> $(document).ready(function() { var green = jQuery("td[name='green']"); green.each(function(){ var cl = $(this).attr('class'); var prev = $(this).prev(); $(this) .css('border-color','#aeaeae') .css('border-style','dotted') .css('border-right-style','solid') .css('border-right-color','black') .addClass(function(i,currentClass){ return "dotted"; }); if (prev.attr('class') == "dottedRightBorder") { prev.css('border-right-style','dotted') .css('border-right-color','#aeaeae') } if (cl=="top") { $(this) .css('border-top-style','solid') .css('border-top-color','black') } else if (cl=="bottom"){ $(this) .css('border-bottom-style','solid') .css('border-bottom-color','black') } }); }); </script> </head> <body> <div class="geniusPicks"> <table cellpadding="1" cellspacing="0"> <thead> <tr id="picksHeading"> <th class="borderLeftRadius">Sport</th> <th>Status</th> <th colspan="2">Pick</th> <th>Genius</th> <th>Genius Credential</th> <th class="borderRightRadius">Result</th> </tr> </thead> <tbody> <tr class="bigGap"> <td colspan="7"></td> </tr> <tr class="pickHeading"> <td colspan="7" class="borderLeftRadius">blah</td> </tr> <tr class="pickConsensusBody"> <td rowspan="4">moo</td> <td rowspan="4">flah</td> <td rowspan="4" class="dottedRightBorder">glah</td> <td name="green" class="top">vlah</td> <td>mlah</td> <td>nlah</td> <td rowspan="4">jlah</td> </tr> <tr class="pickConsensusBody"> <td name="green" >clah</td> <td>dlah</td> <td>xlah</td> </tr> <tr class="pickConsensusBody"> <td name="green" >plah</td> <td>slah</td> <td>klah</td> </tr> <tr class="pickConsensusBody"> <td name="green" class="bottom">qlah</td> <td>wlah</td> <td>zlah</td> </tr> <tr class="smallGap"> <td colspan="7"></td> </tr> <tr class="pickHeading"> <td colspan="7" class="borderLeftRadius">blah</td> </tr> <tr class="pickBody"> <td rowspan="4">moo</td> <td rowspan="4">flah</td> <td rowspan="4" class="dottedRightBorder">glah</td> <td name="green" class="top">vlah</td> <td>mlah</td> <td>nlah</td> <td rowspan="4">jlah</td> </tr> <tr class="pickBody"> <td name="green" >clah</td> <td>dlah</td> <td>xlah</td> </tr> <tr class="pickBody"> <td name="green">plah</td> <td>slah</td> <td>klah</td> </tr> <tr class="pickBody"> <td name="green" class="bottom">qlah</td> <td>wlah</td> <td>zlah</td> </tr> <tr class="smallGap"> <td colspan="7"></td> </tr> </tbody> </table> </div>
Yaroslav Rakhmatullin
source share