Solved

strip table rows with input boxes so looks like excel

Posted on 2013-01-14
2
220 Views
Last Modified: 2013-01-22
uisng javascript, jquery I need the following to be styled so that the rows are striped
and the input boxes within are part of the striping so that it appears the input area is the table border that is the cell, in other words, Excel like.




h += "<tbody id='4_TimeCard_Rows'  ref=cdhrows>\
<tr  class='repeating'>\
<td id='R4:C1' xl='A'><input class='ChargeCodeKey' type='hidden' style='width:200px'><input class='HourCodeId' type='hidden' ><input class='HourCodeDesc input-large' ></td>\
<td id='R4:C2' xl='B'><input class='fund'  id='fund_1' name='fund_1' path=BT20.IFPYTcImp  region=time-entry onblur='updateXML($(this))' ></td>\
<td id='R4:C3' xl='C'><input class='dept'  id='dept_1' name='dept_1' path=BT20.IFPYTcImp  ></td>\
<td id='R4:C4' xl='D'><input class='loc' id='loc_1' name='loc_1' value='' ></td>\
<td id='R4:C5' xl='E'><input class='obj' id='obj_1' name='obj_1' style=\"display:block\"></td>\
<td id='R4:C6' xl='F'><input class='proj' id='proj_1' name='proj_1'  ></td>\
<td id='R4:C7' xl='G'><input class='task' id='task_1' name='task_1' ></td>\
<td id='R4:C8' xl='H'><input class='Total_Day1_Day14 ' ></td>\
<td id='R4:C9' xl='I'><input class='Day1' id='Day1_1' name='Day1_1' ></td>\
<td id='R4:C10' xl='J'><input class='Day2'  id='Day2_1' name='Day2_1' ></td>\
<td id='R4:C11' xl='K'><input class='Day3'  id='Day3_1' name='Day3_1' ></td>\
<td id='R4:C12' xl='L'><input class='Day4'  id='Day4_1' name='Day4_1' ></td>\
<td id='R4:C13' xl='M'><input class='Day5'  id='Day5_1' name='Day5_1' ></td>\
<td id='R4:C14' xl='N'><input class='Day6'  id='Day6_1' name='Day6_1' ></td>\
<td id='R4:C15' xl='O'><input class='Day7'  id='Day7_1' name='Day7_1' ></td>\
<td id='R4:C16' xl='P'><input class='Total_Day1_Day7'></td>\
<td id='R4:C17' xl='Q'><input class='Day8'  id='Day8_1' name='Day8_1' ></td>\
<td id='R4:C18' xl='R'><input class='Day9'  id='Day9_1' name='Day9_1' ></td>\
<td id='R4:C19' xl='S'><input class='Day10'  id='Day10_1' name='Day10_1' ></td>\
<td id='R4:C20' xl='T'><input class='Day11'  id='Day1_11' name='Day1_11' ></td>\
<td id='R4:C21' xl='U'><input class='Day12'  id='Day1_12' name='Day1_12' ></td>\
<td id='R4:C22' xl='V'><input class='Day13'  id='Day1_13' name='Day1_13' ></td>\
<td id='R4:C23' xl='W'><input class='Day14'  id='Day1_14' name='Day1_14'  ></td>\
<td id='R4:C24' xl='X'><input class='Total_Day8_Day14' ></td>\
<td id='R4:C25' xl='Y' ><input type='text' class='comments'  id='comments_1' name='comments_1' maxlength='40' ></td>\
<td id='R4:C26' xl='Z' class='add'>+</td>\
</tr>\
</tbody>"
0
Comment
Question by:KeithMcElroy
2 Comments
 
LVL 9

Expert Comment

by:Sar1973
ID: 38777750
I suggesto you to take a look to the table tag properties, either if you intend to place input boxes inside the cells or not.
0
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 500 total points
ID: 38784588
Zebra striping via css3 (no scripting needed !):
table tr:nth-child(even) {
  background-color: blue;
}

table tr:nth-child(odd) {
  background-color: white;
}

Open in new window


If you want to 'blend in' the textboxes, remove the borders en set background-color to transparent
table input {
   border: medium none;
   background-color: transparent;
}

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do specify keydowns in JavaScript 3 42
Javasctipt 2 24
Html5 Index on a table 7 25
Best Way to remove the port from a URL? 15 32
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

813 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

14 Experts available now in Live!

Get 1:1 Help Now