Solved

strip table rows with input boxes so looks like excel

Posted on 2013-01-14
2
218 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can display objects ? 3 18
angular2 2 way binding on load 7 38
Don't understand jquery promises 6 36
jquery conditionally populate list boxes 2 18
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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)
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…

932 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