Solved

strip table rows with input boxes so looks like excel

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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…
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…

705 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