Search Results

Search found 3282 results on 132 pages for 'tr raziel'.

Page 7/132 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Javascript not working in IE but works in Firefox chrome

    - by user1290528
    So i have the following php page with a java script that gets the total of items based on their quatity, then inputs the total into a text box for each item. In ie the text boxes are being filled with $NaN. While in firefox, chrome the text boxes are filled with the correct values. Any help would be graatly appreciated. <?php echo $_SESSION['SESS_MEMBER_ID']; require_once('auth.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>Breakfast Menu</title> <link href="loginmodule.css" rel="stylesheet" type="text/css"> <script type='text/javascript'> var totalarray=new Array(); var totalarray2= new Array(); var runningtotal = 0; var runningtotal2 = 0; var discount = .2; var discounttotal = 0; var discount1 = 0; runningtotal = runningtotal * 1; runningtotal2 = runningtotal2 * 1; function displayResult(price,init) { var newstring = "quantity"+init; var totstring = "total"+init; var quantity = document.getElementById(newstring).value; var quantity = parseFloat(quantity); var test = price * quantity; var test = test.toFixed(2); document.getElementById(newstring).value = quantity; document.getElementById(totstring).value = "$" + test; totalarray[init] = test; getTotal(); } function getTotal(){ runningtotal = 0; var i=0; for (i=0;i<totalarray.length;i++){ totalarray[i] = totalarray[i] *1; runningtotal = runningtotal + totalarray[i]; discounttotal = totalarray[i] * discount; discounttotal = totalarray[i] - discounttotal; This line is where IE shows its first error document.getElementById('totalcost').value="$" + runningtotal.toFixed(2); } var orderpart1 = document.getElementById('totalcost').value; var orderpart1 = orderpart1.substr(1); var orderpart1 = orderpart1 * 1; var orderpart2 = document.getElementById('totalcost2').value; var orderpart2 = orderpart2.substr(1); var orderpart2 = orderpart2 * 1; var ordertot = orderpart1 + orderpart2; document.getElementById('ordertotal').value ="$"+ ordertot.toFixed(2) } function displayResult2(price2,init2) { var newstring2 = "quantity2"+init2; var totstring2 = "total2"+init2; var quantity2 = document.getElementById(newstring2).value; var quantity2 = parseFloat(quantity2); var test2 = price2 * quantity2; var test2 = test2.toFixed(2); document.getElementById(newstring2).value = quantity2; document.getElementById(totstring2).value = "$" + test2; totalarray2[init2] = test2; getTotal2(); } function getTotal2(){ runningtotal2 = 0; var i=0; for (i=0;i<totalarray2.length;i++){ totalarray2[i] = totalarray2[i] *1; runningtotal2 = runningtotal2+ totalarray2[i]; This is where IE shows its second error document.getElementById('totalcost2').value="$" + runningtotal2.toFixed(2); }//IE Shows Second error here var orderpart1 = document.getElementById('totalcost').value; var orderpart1 = orderpart1.substr(1); var orderpart1 = orderpart1 * 1; var orderpart2 = document.getElementById('totalcost2').value; var orderpart2 = orderpart2.substr(1); var orderpart2 = orderpart2 * 1; var ordertot = orderpart1 + orderpart2; document.getElementById('ordertotal').value ="$"+ ordertot.toFixed(2); } </script> </head> <body> <?php include("newnew.php"); ?> <td style="vertical-align: top; width: 80%; height:80%;"><br> <div style="text-align: center;"> <form action="testplaceorder.php" method="post" onSubmit="return confirm('Are you sure?');"> <h4>Employee Breakfast Order Form</h4> <h1 align="left">Breakfest Foods</h1> <table border='0' cellpadding='0' cellspacing='0'> <tr> <td> <table width="100%" border="1"> <tr> <th>Item&nbsp&nbsp&nbsp&nbsp&nbsp</th> <th>Price&nbsp&nbsp&nbsp&nbsp&nbsp </th> <th>Quantity&nbsp&nbsp&nbsp&nbsp&nbsp</th> <th>Total&nbsp&nbsp&nbsp&nbsp&nbsp</th> </tr> <?php mysql_connect("localhost", "seniorproject", "farmingdale123") or die(mysql_error()); mysql_select_db("fsenior") or die(mysql_error()); $result = mysql_query("SELECT name, price,foodid FROM Food where foodtype='br'") or die(mysql_error()); $init = 0; while(list($name, $price, $brId) = mysql_fetch_row($result)) { echo "<tr> <td>$name</td> <td>\$$price</td> <td><select name='quantity$init' id='quantity$init' onchange='displayResult($price,$init)'><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option></td> <td><input name='total$init' type='text' id='total$init' readonly='readonly' value='\$0.00'></td> </tr>" ; echo "<script type='text/javascript'>displayResult($price,$init);</script>"; $foodname = "'SESS_FOODNAME_" . $init . "'"; $foodid = "'SESS_FOODID_" . $init."'"; $_SESSION[$foodname] = $name; $_SESSION[$foodid] = $brId; $init = $init+1; } $_SESSION['SESS_INIT'] = $init; ?> <tr> <td></td> <td></td> <td>Total Cost</td> <td><input name='totalcost' type='text' id='totalcost' readonly='readonly' value='$0.00'></td> </tr> <tr><td></td><td></td><td>Discount</td><td><input name='discountvalue1' id ='discountvalue1' type='text' readonly='readonly' value='20%'></td> </tr> <tr><td></td><td></td><td>Total After Discount</td><td><input name='discounttotal1' id ='discounttotal1' type='text' readonly='readonly' value='$0.00'></td></tr> </table> <tr> <td><br></td> </tr> </table> <h1 align="left">Breakfest Drinks</h1> <table border='0' cellpadding='0' cellspacing='0'> <tr> <td> <table width="100%" border="1"> <tr> <th>Item&nbsp&nbsp&nbsp&nbsp&nbsp</th> <th>Price&nbsp&nbsp&nbsp&nbsp&nbsp </th> <th>Quantity&nbsp&nbsp&nbsp&nbsp&nbsp</th> <th>Total&nbsp&nbsp&nbsp&nbsp&nbsp</th> </tr> <?php mysql_connect("localhost", "****", "***") or die(mysql_error()); mysql_select_db("fsenior") or die(mysql_error()); $result2 = mysql_query("SELECT drinkname, price,drinkid FROM Drinks where drinktype='br'") or die(mysql_error()); $init2 = 0; while(list($name2, $price2, $brId2) = mysql_fetch_row($result2)) { echo "<tr> <td>$name2</td> <td>\$$price2</td> <td><select name='quantity2$init2' id='quantity2$init2' onchange='displayResult2($price2,$init2)'><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option></td> <td><input name='total2$init2' type='text' id='total2$init2' readonly='readonly' value='\$0.00'></td> </tr>" ; echo "<script type='text/javascript'>displayResult2($price2,$init2);</script>"; $drinkname = "'SESS_DRINKNAME_" . $init2 . "'"; $drinkid = "'SESS_DRINKID_" . $init2."'"; $_SESSION[$drinkname] = $name2; $_SESSION[$drinkid] = $brId2; $init2 = $init2+1; } $_SESSION['SESS_INIT2'] = $init2; ?> <tr> <td></td> <td></td> <td>Total Cost</td> <td><input name='totalcost2' type='text' id='totalcost2' readonly='readonly' value='$0.00'></td> </tr> </table> <tr> <td><br></td> </tr> </table> <table border="2"> <tr><td>Total Order Cost:</td><td> <?php echo "<input name='ordertotal' type='text' id='ordertotal' readonly='readonly' value='\$0.00'></td></table>"; ?> <p align="left"><input type='submit' name='submit' value='Submit'/></p> </form> </div></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </body> </html>

    Read the article

  • rendering a grid from a table: "this.mainBody is undefined"

    - by farhad
    Hello! I have a static html table on a page and i would like to transform it to a grid; so i applied this function after loading the table: function createTable() { // create the grid var grid = new Ext.ux.grid.TableGrid("tabella-colocazioni", { stripeRows: true // stripe alternate rows }); grid.render(); } I got this piece of code from here: http://www.java2s.com/Code/JavaScript/Ext-JS/CreateagridwithfromanexistingunformattedHTMLtable.htm . The result is the error "this.mainBody is undefined on ext-all-debug.js" on FireBug and the grid is empty. The html code of the table is this: <table cellspacing="0" id="tabella-colocazioni"> <thead> <tr style="background:#eeeeee;"> <th>Colocazione</th> <th>Frequenza</th> </tr> </thead> <tbody> <tr> <td>plusquam patria</td> <td>1</td> </tr> <tr> <td>patria pietate</td> <td>1</td> </tr> <tr> <td>Et patria</td> <td>1</td> </tr> <tr> <td>patria prohibet</td> <td>1</td> </tr> <tr> <td>Multos patria</td> <td>1</td> </tr> <tr> <td>patria reddidit</td> <td>1</td> </tr> <tr> <td>patronum patria</td> <td>1</td> </tr> <tr> <td>patria moesta</td> <td>1</td> </tr> </tbody> </table> What is the problem? Thank you very much.

    Read the article

  • Problems with multiple setIntervals running simultaneously

    - by Roel V.
    Hello, My first post here. I want to make a horizontal menu with submenu's sliding down on mouseover. I know I could use jQuery but this is to practice my javascript skills. I use the following code: var up = new Array() var down = new Array() var submenustart function titleover(headmenu, inter) { submenu = headmenu.lastChild up[inter] = window.clearInterval(up[inter]) down[inter] = window.setInterval("slidedown(submenu)",1) } function slidedown(submenu) { if(submenu.offsetTop < submenustart) { submenu.style.top = submenu.offsetTop + 1 + "px" } } function titleout(headmenu, inter) { submenu = headmenu.lastChild down[inter] = window.clearInterval(down[inter]) up[inter] = window.setInterval("slideup(submenu)", 1) } function slideup(submenu) { if(submenu.offsetTop > submenustart - submenu.clientHeight + 1) { submenu.style.top = submenu.offsetTop - 1 + "px" } } The variable submenustart gets appointed a value in another function which is not relevant for my question. HTML looks like this: <table class="hoofding" id="hoofding"> <tr> <td onmouseover="titleover(this, 0)" onmouseout="titleout(this, 0)"><a href="#" class="hoofdinglink" id="hoofd1">AAAA</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> </table></td> <td onmouseover="titleover(this, 1)" onmouseout="titleout(this, 1)"><a href="#" class="hoofdinglink">BBBB</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> <tr><td><a href="...">4444</a></td></tr> <tr><td><a href="...">5555</a></td></tr> </table></td> ... </tr> </table> What happens is the following: If I go over and out (for ex) menu A it works fine. If i go now over menu B the interval applied to A is now applied to B. There are now 2 interval functions applied to B. The one originally for A and a new one triggered by the mouseover on B. If I would go to A all the intervals are now applied to A. I have been searching for hours but and I am completely stuck. Thanks in advance.

    Read the article

  • Problems with multiple setIntervals running simultaniously

    - by Roel V.
    Hello, My first post here. I want to make a horizontal menu with submenu's sliding down on mouseover. I know I could use jQuery but this is to practice my javascript skills. I use the following code: var up = new Array() var down = new Array() var submenustart function titleover(headmenu, inter) { submenu = headmenu.lastChild up[inter] = window.clearInterval(up[inter]) down[inter] = window.setInterval("slidedown(submenu)",1) } function slidedown(submenu) { if(submenu.offsetTop < submenustart) { submenu.style.top = submenu.offsetTop + 1 + "px" } } function titleout(headmenu, inter) { submenu = headmenu.lastChild down[inter] = window.clearInterval(down[inter]) up[inter] = window.setInterval("slideup(submenu)", 1) } function slideup(submenu) { if(submenu.offsetTop > submenustart - submenu.clientHeight + 1) { submenu.style.top = submenu.offsetTop - 1 + "px" } } The variable submenustart gets appointed a value in another function which is not relevant for my question. HTML looks like this: <table class="hoofding" id="hoofding"> <tr> <td onmouseover="titleover(this, 0)" onmouseout="titleout(this, 0)"><a href="#" class="hoofdinglink" id="hoofd1">AAAA</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> </table></td> <td onmouseover="titleover(this, 1)" onmouseout="titleout(this, 1)"><a href="#" class="hoofdinglink">BBBB</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> <tr><td><a href="...">4444</a></td></tr> <tr><td><a href="...">5555</a></td></tr> </table></td> ... </tr> </table> What happens is the following: If I go over and out (for ex) menu A it works fine. If i go now over menu B the interval applied to A is now applied to B. There are now 2 interval functions applied to B. The one originally for A and a new one triggered by the mouseover on B. If I would go to A all the intervals are now applied to A. I have been searching for hours but and I am completely stuck. Thanks in advance.

    Read the article

  • Need help with regex parsing (in perl)

    - by Charlie
    Hi all, need some help parsing an html file in perl. I used the LWP module to retrieve a webpage into $_ with $/ undefined so there are no newline issues. Then I'm trying to find all strings matching a pattern. How do I do that? I know how to find 1 instance of it, but how do I match all instances? and what data structure would the results go to? a multi dimensional array? my text (excerpt) looks like the following: <TR> <TD BGCOLOR=EEEEEE><A HREF="/program.cgi?pid=1233"><FONT FACE="ARIAL,HELVETICA,SANS-SERIF" SIZE=2>Title 1</A></FONT></TD> <TD BGCOLOR=EEEEEE nowrap><FONT FACE="ARIAL,HELVETICA" SIZE=2>Jun 27 2010 3:00PM</FONT></TD> <TD BGCOLOR=EEEEEE>&nbsp;</TD> </TR> <TR><TD BGCOLOR=EEEEEE COLSPAN=3><IMG SRC="http://images.domain.com/images/spacer.gif" WIDTH=1 HEIGHT=2><BR></TD></TR> <TR><TD COLSPAN=3 BGCOLOR=999999><IMG SRC="http://images.domain.com/images/spacer.gif" HEIGHT=1 WIDTH=1></TD></TR> <TR><TD COLSPAN=3 ><IMG SRC="http://images.domain.com/images/spacer.gif" WIDTH=1 HEIGHT=2><BR></TD></TR> <TR> <TD><A HREF="/program.cgi?pid=1234"><FONT FACE="ARIAL,HELVETICA,SANS-SERIF" SIZE=2>Title 2</A></FONT></TD> <TD nowrap><FONT FACE="ARIAL,HELVETICA" SIZE=2>Jun 29 2010 7:00PM</FONT></TD> <TD>&nbsp;</TD> </TR> <TR><TD COLSPAN=3><IMG SRC="http://images.domain.com/images/spacer.gif" WIDTH=1 HEIGHT=2><BR></TD></TR> <TR><TD COLSPAN=3 BGCOLOR=999999><IMG SRC="http://images.domain.com/images/spacer.gif" HEIGHT=1 WIDTH=1></TD></TR> <TR><TD COLSPAN=3 BGCOLOR=EEEEEE><IMG SRC="http://images.domain.com/images/spacer.gif" WIDTH=1 HEIGHT=2><BR></TD></TR> <TR> <TD BGCOLOR=EEEEEE><A HREF="/program.cgi?pid=1235"><FONT FACE="ARIAL,HELVETICA,SANS-SERIF" SIZE=2>Title 3</A></FONT></TD> <TD BGCOLOR=EEEEEE nowrap><FONT FACE="ARIAL,HELVETICA" SIZE=2>Jul 3 2010 7:00PM</FONT></TD> <TD BGCOLOR=EEEEEE>&nbsp;</TD> </TR> I want to get the following into an array (or any structure): { ["/program.cgi?pdi=1233", "Title 1"], ["/program.cgi?pdi=1234", "Title 2"], ["/program.cgi?pdi=1235", "Title 3"] } Thanks

    Read the article

  • Comparing 2 tables column values and copying the next column content to the second table

    - by Sullan
    Hi All.. I am comparing between two tables first column each. If there is find a match i am copying the text from the adjacent cell of the first table to the second table. I am able to compare strings and get the value, but finding it difficult to print it in the second table. I am getting the value in the var "replaceText", but how to print it in the second table ?? Please help... Sample code is as follows.. <script type="text/javascript"> jQuery.noConflict(); jQuery(document).ready(function(){ jQuery('.itemname').each(function(){ var itemName = jQuery(this).text(); jQuery('.comparerow').each(function() { var compareRow = jQuery(this).text(); if (itemName == compareRow) { var replaceText = jQuery(this).next('td').text(); alert(replaceText); } }); }); }); </script> HTML is as follows <table width="100%"><thead> <tr> <th align="left" >Name</th><th>Description</th></tr></thead> <tbody> <tr> <td class="comparerow">IX0001</td> <td class="desc">Desc 1 </td> </tr> <tr> <td class="comparerow">IX0002</td> <td class="desc" >Desc 2 </td> </tr> <tr> <td class="comparerow">IX0003</td> <td class="desc">Desc 3 </td> </tr> <tr> <td class="comparerow">IX0004</td> <td class="desc">Desc 4 </td> </tr> </tbody> </table> <br /> <table width="100%"> <tr> <th>Name</th><th>Description</th> </tr> <tr > <td class="itemname">IX0001</td><td></td> </tr> <tr> <td class="itemname">IX0002</td><td></td> </tr> <tr> <td class="itemname">IX0003</td><td></td> </tr> </table>

    Read the article

  • javascript: Problems with multiple setIntervals running simultaniously

    - by user340879
    Hello, My first post here. I want to make a horizontal menu with submenu's sliding down on mouseover. I know I could use jQuery but this is to practice my javascript skills. I use the following code: var up = new Array() var down = new Array() var submenustart function titleover(headmenu, inter) { submenu = headmenu.lastChild up[inter] = window.clearInterval(up[inter]) down[inter] = window.setInterval("slidedown(submenu)",1) } function slidedown(submenu) { if(submenu.offsetTop < submenustart) { submenu.style.top = submenu.offsetTop + 1 + "px" } } function titleout(headmenu, inter) { submenu = headmenu.lastChild down[inter] = window.clearInterval(down[inter]) up[inter] = window.setInterval("slideup(submenu)", 1) } function slideup(submenu) { if(submenu.offsetTop > submenustart - submenu.clientHeight + 1) { submenu.style.top = submenu.offsetTop - 1 + "px" } } The variable submenustart gets appointed a value in another function which is not relevant for my question. HTML looks like this: <table class="hoofding" id="hoofding"> <tr> <td onmouseover="titleover(this, 0)" onmouseout="titleout(this, 0)"><a href="#" class="hoofdinglink" id="hoofd1">AAAA</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> </table></td> <td onmouseover="titleover(this, 1)" onmouseout="titleout(this, 1)"><a href="#" class="hoofdinglink">BBBB</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> <tr><td><a href="...">4444</a></td></tr> <tr><td><a href="...">5555</a></td></tr> </table></td> ... </tr> </table> What happens is the following: If I go over and out (for ex) menu A it works fine. If i go now over menu B the interval applied to A is now applied to B. There are now 2 interval functions applied to B. The one originally for A and a new one triggered by the mouseover on B. If I would go to A all the intervals are now applied to A. I have been searching for hours but and I am completely stuck. Thanks in advance.

    Read the article

  • Hide/Show some HTML table cells individually and align the remaining cells as they belong to the same row [closed]

    - by Brian
    [Edited at the resquest of admins] The best way I can explain my problem is showning an example. I have the table that you can see on the link below (since I can't post images...), that ha a table head (blue) and four rows, whose cells are green and white in color. I just want the white cells to hide/show alternately by clicking on green cells, which would remain always visible as parent cells. After hiding white cells, the green ones should be aligned into the same row, as they would fit like tetris bricks. That's all, I think more clear is impossible. http://i.stack.imgur.com/3n3In.jpg (follow the link to see the image explanation) The table code: <table class="columns" cellspacing="0" border="0"> <tr> <td class="left" rowspan="2"> <div style="text-align:center;"></div> </td> </tr><tr><td class="middle"> <div id="detail_table_source" style="display:none"></div> <br> <table id="detail_table" class="detail"> <colgroup> <col style="width:20px;"> <col style="width:40px;"> <col style="width:70px;"> <col style="width:20px;"> </colgroup> <thead> <tr> <th width="88">Blahhh</th> <th width="211">BLAHH</th> <th width="229">BLAHH</th> </tr> </thead> <tbody> <tr class="parent" id="row123" style="cursor: pointer; " title="Click to expand/collapse"> <td bgcolor="#A6A4CC">Blahhh</td> <td bgcolor="#A6A4CC">blah blah </td> <td bgcolor="#A6A4CC">Blahh</td> </tr> <tr class="child-row123" style="display: none; "> <td rowspan="3" bgcolor="#5B5B5B">&nbsp;</td> <td>blah blah </td> <td>blah blah</td> </tr> <tr class="child-row123" style="display: none; "> <td>blah blah</td> <td>blah blah</td> </tr> <tr class="child-row123" style="display: none; "> <td>blah blah</td> <td>blah blah</td> </tr> <tr> <td bgcolor="#6B7A94" class="parent" id="row456" style="cursor: pointer; " title="Click to expand/collapse"><strong>Blahh</strong></td> <td bgcolor="#FFFFFF" class="child-cell456" style="display: none; ">blah blah</td> <td bgcolor="#FFFFFF" class="child-cell456" style="display: none; ">blah blah</td> </tr> <tr> <td rowspan="4" valign="top" bgcolor="#5B5B5B" class="child-row456" style="display: none; ">&nbsp;</td> <td bgcolor="#6B7A94" class="parent" id="cell456" style="cursor: pointer; " title="Click to expand/collapse">blah blah</td> <td bgcolor="#6B7A94" class="parent" id="cell456" style="cursor: pointer; " title="Click to expand/collapse">blah blah</td> </tr> <tr> <td class="child-cell456" style="display: none; ">blah blah</td> <td class="child-cell456" style="display: none; ">blah blah</td> </tr> <tr> <td class="child-cell456" style="display: none; ">blah blah</td> <td class="child-cell456" style="display: none; ">blah blah</td> </tr> </tbody> </table> The script to hide/show whole rows (this works because it is copied from another example): <script language="javascript"> $(function() { $('tr.parent') .css("cursor","pointer") .attr("title","Click to expand/collapse") .click(function(){ $(this).siblings('.child-'+this.id).toggle(); }); $('tr[@class^=child-]').hide().children('td'); }); </script> And the failed attempt at expanding/hiding individual cells: <script language="javascript"> $(function() { $('td.parent') .css("cursor","pointer") .attr("title","Click to expand/collapse") .click(function(){ $(this).siblings('.child-'+this.id).toggle(); }); $('td[@class^=child-]').hide().children('td'); }); </script>

    Read the article

  • Adding proper THEAD sections to a GridView

    - by Rick Strahl
    I’m working on some legacy code for a customer today and dealing with a page that has my favorite ‘friend’ on it: A GridView control. The ASP.NET GridView control (and also the older DataGrid control) creates some pretty messed up HTML. One of the more annoying things it does is to generate all rows including the header into the page in the <tbody> section of the document rather than in a properly separated <thead> section. Here’s is typical GridView generated HTML output: <table class="tablesorter blackborder" cellspacing="0" rules="all" border="1" id="Table1" style="border-collapse:collapse;"> <tr> <th scope="col">Name</th> <th scope="col">Company</th> <th scope="col">Entered</th><th scope="col">Balance</th> </tr> <tr> <td>Frank Hobson</td><td>Hobson Inc.</td> <td>10/20/2010 12:00:00 AM</td><td>240.00</td> </tr> ... </table> Notice that all content – both the headers and the body of the table – are generated directly under the <table> tag and there’s no explicit use of <tbody> or <thead> (or <tfooter> for that matter). When the browser renders this the document some default settings kick in and the DOM tree turns into something like this: <table> <tbody> <tr> <-- header <tr> <—detail row <tr> <—detail row </tbody> </table> Now if you’re just rendering the Grid server side and you’re applying all your styles through CssClass assignments this isn’t much of a problem. However, if you want to style your grid more generically using hierarchical CSS selectors it gets a lot more tricky to format tables that don’t properly delineate headers and body content. Also many plug-ins and other JavaScript utilities that work on tables require a properly formed table layout, and many of these simple won’t work out of the box with a GridView. For example, one of the things I wanted to do for this app is use the jQuery TableSorter plug-in which – not surprisingly – requires to work of table headers in the DOM document. Out of the box, the TableSorter plug-in doesn’t work with GridView controls, because the lack of a <thead> section to work on. Luckily with a little help of some jQuery scripting there’s a real easy fix to this problem. Basically, if we know the GridView generated table has a header in it, code like the following will move the headers from <tbody> to <thead>: <script type="text/javascript"> $(document).ready(function () { // Fix up GridView to support THEAD tags $("#gvCustomers tbody").before("<thead><tr></tr></thead>"); $("#gvCustomers thead tr").append($("#gvCustomers th")); $("#gvCustomers tbody tr:first").remove(); $("#gvCustomers").tablesorter({ sortList: [[1, 0]] }); }); </script> And voila you have a table that now works with the TableSorter plug-in. If you use GridView’s a lot you might want something a little more generic so the following does the same thing but should work more generically on any GridView/DataGrid missing its <thead> tag: function fixGridView(tableEl) {            var jTbl = $(tableEl);         if(jTbl.find("tbody>tr>th").length > 0) {         jTbl.find("tbody").before("<thead><tr></tr></thead>");         jTbl.find("thead tr").append(jTbl.find("th"));         jTbl.find("tbody tr:first").remove();     } } which you can call like this: $(document).ready(function () { fixGridView( $("#gvCustomers") ); $("#gvCustomers").tablesorter({ sortList: [[1, 0]] }); }); Server Side THEAD Rendering [updated from comments 11/21/2010] Several commenters pointed out that you can also do this on the server side by using the GridView.HeaderRow.TableSection property to force rendering with a proper table header. I was unaware of this option actually – not exactly an easy one to discover. One issue here is that timing of this needs to happen during the databinding process so you need to use an event handler: this.gvCustomers.DataBound += (object o, EventArgs ev) => { gvCustomers.HeaderRow.TableSection = TableRowSection.TableHeader; }; this.gvCustomers.DataSource = custList; this.gvCustomers.DataBind(); You can apply the same logic for the FooterRow. It’s beyond me why this rendering mode isn’t the default for a GridView – why would you ever want to have a table that doesn’t use a THEAD section??? But I disgress :-) I don’t use GridViews much anymore – opting for more flexible approaches using ListViews or even plain code based views or other custom displays that allow more control over layout, but I still see a lot of old code that does use them old clunkers including my own :) (gulp) and this does make life a little bit easier especially if you’re working with any of the jQuery table related plug-ins that expect a proper table structure.© Rick Strahl, West Wind Technologies, 2005-2010Posted in ASP.NET  jQuery  

    Read the article

  • Modifying a HTML page to fix several "bugs" add a function to next/previous on a option dropdown

    - by Dennis Sylvian
    SOF, I've got a few problems plaguing me at the moment and am wondering if anyone could assist me with them. I'm trying to get Next Class | Previous Class to act as buttons so that when Next Class is clicked it will go to the next item in the dropdown list and for previous it would go to back one. There used to be a scroll bar that allowed me to scroll the main window left and right, it's missing because (I think it was to do with the scroll left and scroll right function) The footer at the bottom doesn't show correctly on mobile devices; for some reason it appears completely differently to as it does on a computer. The "bar" practically and the Scroll Left and Scroll buttons don't appear at all on mobile devices. The scroll left button is unable to be clicked for some reason, I'm unsure what I've done wrong. Refreshing the page resets the horizontal scroll position to far left (I'm pretty sure this relates to the scroll bar) I want to also find a way so that on mobile devices the the header will not show the placeholder image, however I can't work out what CSS media tag(s) I should be using. Latest: http://jsfiddle.net/pwv7u/ Smaller HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>DATA DATA DATA DATA DATA DATA DATA DATA</title> <style type="text/css"> <!-- @import url("nstyle.css"); --> </style> <script src="jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready( function() { for (var i=0;i<($("table").children().length);i++){ if(readCookie(i)) $($($("table").children()[i]).children()[(readCookie(i))]).toggleClass('selected').siblings().removeClass('selected'); } $("tr").click(function(){ $(this).toggleClass('selected').siblings().removeClass('selected'); if(readCookie($(this).parent().index())){ if(readCookie($(this).parent().index())==$(this).index()) eraseCookie($(this).parent().index()); else{ eraseCookie($(this).parent().index()); createCookie($(this).parent().index(),$(this).index(),1); } } else createCookie($(this).parent().index(),$(this).index(),1); }); // gather CLASS info var selector = $('.class-selector').on('change', function(){ var id = this.value; if (id!==''){ scrollToAnchor(id); } }); $('a[id^="CLASS"]').each(function(){ var id = this.id, option = $('<option>',{ value: this.id, text:this.id }); selector.append(option); }); function scrollToAnchor(aid) { var aTag = $("a[id='" + aid + "']"); $('html,body').animate({ scrollTop: aTag.offset().top - 80 }, 1); } $("a.TOPJS").click(function () { scrollToAnchor('TOP'); }); $("a.KEYJS").click(function () { scrollToAnchor('KEY'); }); $("a.def").click(function () { $('#container').animate({ "scrollLeft": "-=204" }, 200); }); $("a.abc").click(function () { $("#container").animate({ "scrollLeft": "+=204" }, 200); }); function createCookie(name,value,days) { var expires; if (days) { var date = new Date(); date.setMilliseconds(0); date.setSeconds(0); date.setMinutes(0); date.setHours(0); date.setDate(date.getDate()+days); expires = "; expires="+date.toGMTString(); } else expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } }); </script> </head> <body> <div id="header_container"> <div id="header"> <a href="http://site.x/" target="_blank"><img src="http://placehold.it/300x80"></a> <select class="class-selector"> <option value="">-select class-</option> </select> <div class="classcycler"> <a href="#TOP"><font color=#EFEFEF>Next Class</font></a> <font color=red>|</font> <a href="#TOP"><font color=#EFEFEF>Previous Class</font></a> </div> <div id="header1"> Semi-Transparent Image <a href="#TOP"><font color=#EFEFEF>Up to Top</font></a> | <a href="#KEY"><font color=#EFEFEF>Down to Key</font></a> </div> </div> </div> <a id="TOP"></a> <div id="container"> <table id="gradient-style"> <tbody> <thead> <tr> <th scope="col"><a id="CLASS1"></a>Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class<br>Test 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class Data 1</th> <th scope="col">Class 1<br>Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1<br>Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1</th> <th scope="col">Class 1 Class 1</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> (data text)</th> <th scope="col">title text</th> <th scope="col">text</th> <th scope="col">text</th> <th scope="col">title text</th> <th scope="col">title text</th> </tr> </thead> <tr class="ft3"><td>testing data</td><td>testing data</td><td>test</td><td>class b</td><td>test4</td><td><div align="left">data</div></td><td><div align="left"> </div></td><td><div align="left"></div></td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>test</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><tr> <tr class="f3"><td>test</td><td>test</td><td>test</td><td>class a</td><td>test2</td><td><div align="left"> </div></td><td><div align="left"></div></td><td><div align="left"></div></td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>test</td><tr> <thead> <tr> <th scope="col"><a id="CLASS2"></a>Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class<br>Test 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class Data 2</th> <th scope="col">Class 2<br>Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2<br>Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2</th> <th scope="col">Class 2 Class 2</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> data text</th> <th scope="col">title text<br> (data text)</th> <th scope="col">title text</th> <th scope="col">text</th> <th scope="col">text</th> <th scope="col">title text</th> <th scope="col">title text</th> </tr> </thead> <tr class="ft3"><td>testing data</td><td>testing data</td><td>test</td><td>class f</td><td>test2</td><td><div align="left">data</div></td><td><div align="left"></div></td><td><div align="left">data</div></td><td>test</td><td>test</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><tr> <tr><td>test</td><td>testing data</td><td>test</td><td>class f</td><td>test4</td><td><div align="left">data</div></td><td><div align="left"></div></td><td><div align="left"></div></td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><tr> <tr class="f3"><td>test</td><td>testing data</td><td>testing data</td><td>class d</td><td>test5</td><td><div align="left">data</div></td><td><div align="left"> </div></td><td><div align="left">data</div></td><td>test</td><td>test</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><tr> <tr><td>testing data</td><td>test</td><td>test</td><td>class f</td><td>test5</td><td><div align="left"></div></td><td><div align="left"></div></td><td><div align="left">data</div></td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>test</td><td>test</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>test</td><td>testing data</td><tr> <tr class="f2"><td>test</td><td>test</td><td>testing data</td><td>class a</td><td>test1</td><td><div align="left">data</div></td><td><div align="left"> </div></td><td><div align="left">data</div></td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>test</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>testing data</td><td>test</td><td>testing data</td><td>testing data</td><td>test</td><tr> </tbody> <tfoot> <tr> <th class="alt" colspan="34" scope="col"><a id="KEY"></a><img src="http://placehold.it/300x50"></th> </tr> <tr> <td colspan="34"><em><b>DATA DATA</b> - DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA </em></td> </tr> <tr> <td class="alt" colspan="34"><em><b>DAT DATA</b> - DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA DATA </em></td> </tr> </tfoot> </table> </div> <div id="footer_container"> <div id="footer"> <a href="http://site.x/" target="_blank"><img src="http://placehold.it/300x80"></a> <div class="footleft"> <a class="def" href="javascript: void(0);"><font color="#EFEFEF">Scroll Left</font></a> </div> <div id="footer1"> <font color="darkblue">Semi-Transparent Image</font> <i>Copyright &copy; 2013 <a href="http://site.x/" target="_blank" style="text-decoration: none"><font color=#ADD8E6>site</font></a>.</i> </div> <div id="footer2"> <i>All Rights Reserved.</i> </div> <div class="footright"> <a class="abc" href="javascript: void(0);"><font color="#EFEFEF">Scroll Right</font></a> </div> </div> </div> </body> </html> CSS gradient-style * { white-space: nowrap; } #header .class-selector { top: 10px; left: 20px; position: fixed; } #header .classcycler { top: 45px; left: 20px; position: fixed; font-size:20px; } body { line-height: 1.6em; background-color: #535353; overflow-x: scroll; } #gradient-style { font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; font-size: 12px; margin: 0px; width: 100%; text-align: center; border-collapse: collapse; } #gradient-style th { font-size: 13px; font-weight: normal; line-height:250%; padding-left: 5px; padding-right: 5px; background: #535353 url('table-images/gradhead.png') repeat-x; border-top: 1px solid #fff; border-bottom: 1px solid #fff; color: #ffffff; } #gradient-style th.alt { font-family: "Times New Roman", Serif; text-align: left; padding: 10px; font-size: 26px; } #gradient-style td { padding-left: 5px; padding-right: 5px; border-bottom: 1px solid #fff; border-left: 1px solid #fff; border-right: 1px solid #fff; color: #00000; border-top: 1px solid #fff; background: #FFF url('table-images/gradback.png') repeat-x; } #gradient-style tr.ft3 td { color: #00000; background: #99cde7 url('table-images/gradoverallstudent.png') repeat-x; font-weight: bold; } #gradient-style tr.f1 td { color: #00000; background: #99cde7 url('table-images/gradbeststudent.png') repeat-x; } #gradient-style tr.f2 td { color: #00000; background: #b7e2b6 url('table-images/gradmostattentedstudent.png') repeat-x; } #gradient-style tr.f3 td { color: #00000; background: #a9cd6c url('table-images/gradleastlatestudtent.png') repeat-x; } #gradient-style tfoot tr td { background: #6FA275; font-size: 12px; color: #000; padding: 10; text-align: left; } #gradient-style tbody tr:hover td, #gradient-style tbody tr.selected td { background: #d0dafd url('table-images/gradhover.png') repeat-x; color: #339; } body { margin: 0; padding: 0; } #header_container { background: #000000 url('table-images/gradhead.png') repeat-x; border: 0px solid #666; height: 80px; left: 0; position: fixed; width: 100%; top: 0; } #header { position: relative; margin: 0 auto; width: 500px; height: 100%; text-align: center; color: #0c0aad; } #header1 { position: absolute; width: 125%; top: 50px; } #container { margin: 0 auto; overflow: auto; padding: 80px 0; width: 100%; } #content { } #footer_container { background: #000000 url('table-images/gradhead.png') repeat-x; border: 0px solid #666; bottom: 0; height: 95px; left: 0; position: fixed; width: 100%; } #footer { position: relative; margin: 0 auto; height: 100%; text-align: center; color: #FFF; } #footer1 { position: absolute; width: 103%; top: 50px; } #footer2 { position: absolute; width: 110%; top: 70px; } #footer .footleft { top: 45px; left: 2%; position: absolute; font-size:20px; } #footer .footright { top: 45px; right: 2%; position: absolute; font-size:20px; }

    Read the article

  • Scrolling an HTML 5 page using JQuery

    - by nikolaosk
    In this post I will show you how to use JQuery to scroll through an HTML 5 page.I had to help a friend of mine to implement this functionality and I thought it would be a good idea to write a post.I will not use any JQuery scrollbar plugin,I will just use the very popular JQuery Library. Please download the library (minified version) from http://jquery.com/download.Please find here all my posts regarding JQuery.Also have a look at my posts regarding HTML 5.In order to be absolutely clear this is not (and could not be) a detailed tutorial on HTML 5. There are other great resources for that.Navigate to the excellent interactive tutorials of W3School.Another excellent resource is HTML 5 Doctor.Two very nice sites that show you what features and specifications are implemented by various browsers and their versions are http://caniuse.com/ and http://html5test.com/. At this times Chrome seems to support most of HTML 5 specifications.Another excellent way to find out if the browser supports HTML 5 and CSS 3 features is to use the Javascript lightweight library Modernizr.In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like.You can use Visual Studio 2012 Express edition. You can download it here. Let me move on to the actual example.This is the sample HTML 5 page<!DOCTYPE html><html lang="en">  <head>    <title>Liverpool Legends</title>        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >        <link rel="stylesheet" type="text/css" href="style.css">        <script type="text/javascript" src="jquery-1.8.2.min.js"> </script>     <script type="text/javascript" src="scroll.js">     </script>       </head>  <body>    <header>        <h1>Liverpool Legends</h1>    </header>        <div id="main">        <table>        <caption>Liverpool Players</caption>        <thead>            <tr>                <th>Name</th>                <th>Photo</th>                <th>Position</th>                <th>Age</th>                <th>Scroll</th>            </tr>        </thead>        <tfoot class="footnote">            <tr>                <td colspan="4">We will add more photos soon</td>            </tr>        </tfoot>    <tbody>        <tr class="maintop">        <td>Alan Hansen</td>            <td>            <figure>            <img src="images\Alan-hansen-large.jpg" alt="Alan Hansen">            <figcaption>The best Liverpool Defender <a href="http://en.wikipedia.org/wiki/Alan_Hansen">Alan Hansen</a></figcaption>            </figure>            </td>            <td>Defender</td>            <td>57</td>            <td class="top">Middle</td>        </tr>        <tr>        <td>Graeme Souness</td>            <td>            <figure>            <img src="images\graeme-souness-large.jpg" alt="Graeme Souness">            <figcaption>Souness was the captain of the successful Liverpool team of the early 1980s <a href="http://en.wikipedia.org/wiki/Graeme_Souness">Graeme Souness</a></figcaption>            </figure>            </td>            <td>MidFielder</td>            <td>59</td>        </tr>        <tr>        <td>Ian Rush</td>            <td>            <figure>            <img src="images\ian-rush-large.jpg" alt="Ian Rush">            <figcaption>The deadliest Liverpool Striker <a href="http://it.wikipedia.org/wiki/Ian_Rush">Ian Rush</a></figcaption>            </figure>            </td>            <td>Striker</td>            <td>51</td>        </tr>        <tr class="mainmiddle">        <td>John Barnes</td>            <td>            <figure>            <img src="images\john-barnes-large.jpg" alt="John Barnes">            <figcaption>The best Liverpool Defender <a href="http://en.wikipedia.org/wiki/John_Barnes_(footballer)">John Barnes</a></figcaption>            </figure>            </td>            <td>MidFielder</td>            <td>49</td>            <td class="middle">Bottom</td>        </tr>                <tr>        <td>Kenny Dalglish</td>            <td>            <figure>            <img src="images\kenny-dalglish-large.jpg" alt="Kenny Dalglish">            <figcaption>King Kenny <a href="http://en.wikipedia.org/wiki/Kenny_Dalglish">Kenny Dalglish</a></figcaption>            </figure>            </td>            <td>Midfielder</td>            <td>61</td>        </tr>        <tr>            <td>Michael Owen</td>            <td>            <figure>            <img src="images\michael-owen-large.jpg" alt="Michael Owen">            <figcaption>Michael was Liverpool's top goal scorer from 1997–2004 <a href="http://www.michaelowen.com/">Michael Owen</a></figcaption>            </figure>            </td>            <td>Striker</td>            <td>33</td>        </tr>        <tr>            <td>Robbie Fowler</td>            <td>            <figure>            <img src="images\robbie-fowler-large.jpg" alt="Robbie Fowler">            <figcaption>Fowler scored 183 goals in total for Liverpool <a href="http://en.wikipedia.org/wiki/Robbie_Fowler">Robbie Fowler</a></figcaption>            </figure>            </td>            <td>Striker</td>            <td>38</td>        </tr>        <tr class="mainbottom">            <td>Steven Gerrard</td>            <td>            <figure>            <img src="images\steven-gerrard-large.jpg" alt="Steven Gerrard">            <figcaption>Liverpool's captain <a href="http://en.wikipedia.org/wiki/Steven_Gerrard">Steven Gerrard</a></figcaption>            </figure>            </td>            <td>Midfielder</td>            <td>32</td>            <td class="bottom">Top</td>        </tr>    </tbody></table>          </div>            <footer>        <p>All Rights Reserved</p>      </footer>     </body>  </html>  The markup is very easy to follow and understand. You do not have to type all the code,simply copy and paste it.For those that you are not familiar with HTML 5, please take a closer look at the new tags/elements introduced with HTML 5.When I view the HTML 5 page with Firefox I see the following result. I have also an external stylesheet (style.css). body{background-color:#efefef;}h1{font-size:2.3em;}table { border-collapse: collapse;font-family: Futura, Arial, sans-serif; }caption { font-size: 1.2em; margin: 1em auto; }th, td {padding: .65em; }th, thead { background: #000; color: #fff; border: 1px solid #000; }tr:nth-child(odd) { background: #ccc; }tr:nth-child(even) { background: #404040; }td { border-right: 1px solid #777; }table { border: 1px solid #777;  }.top, .middle, .bottom {    cursor: pointer;    font-size: 22px;    font-weight: bold;    text-align: center;}.footnote{text-align:center;font-family:Tahoma;color:#EB7515;}a{color:#22577a;text-decoration:none;}     a:hover {color:#125949; text-decoration:none;}  footer{background-color:#505050;width:1150px;}These are just simple CSS Rules that style the various HTML 5 tags,classes. The jQuery code that makes it all possible resides inside the scroll.js file.Make sure you type everything correctly.$(document).ready(function() {                 $('.top').click(function(){                     $('html, body').animate({                         scrollTop: $(".mainmiddle").offset().top                     },4000 );                  });                 $('.middle').click(function(){                     $('html, body').animate({                         scrollTop: $(".mainbottom").offset().top                     },4000);                  });                     $('.bottom').click(function(){                     $('html, body').animate({                         scrollTop: $(".maintop").offset().top                     },4000);                  }); });  Let me explain what I am doing here.When I click on the Middle word (  $('.top').click(function(){ ) this relates to the top class that is clicked.Then we declare the elements that we want to participate in the scrolling. In this case is html,body ( $('html, body').animate).These elements will be part of the vertical scrolling.In the next line of code we simply move (navigate) to the element (class mainmiddle that is attached to a tr element.)      scrollTop: $(".mainmiddle").offset().top  Make sure you type all the code correctly and try it for yourself. I have tested this solution will all 4-5 major browsers.Hope it helps!!!

    Read the article

  • jquery selector to count the number of visible table rows?

    - by sprugman
    I've got this html: <table> <tr style="display:table-row"><td>blah</td></tr> <tr style="display:none"><td>blah</td></tr> <tr style="display:none"><td>blah</td></tr> <tr style="display:table-row"><td>blah</td></tr> <tr style="display:table-row"><td>blah</td></tr> </table> I need to count the number of rows that don't have display:none. How can I do that?

    Read the article

  • How can I get popup window using commandButton in Trinidad?

    - by vikram
    How can I get popup window using commandButton in Trinidad? My problem is that by clicking on Add button from dialogdemo.jspx, not any popup window or dialog box is opened. This is dialogdemo.jspx file: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:tr="http://myfaces.apache.org/trinidad" version="1.2"> <jsp:directive.page contentType="text/html;charset=utf-8" /> <f:view> <tr:document title="Dialog Demo"> <tr:form> <!-- The field for the value; we point partialTriggers at the button to ensure it gets redrawn when we return --> <tr:inputText label="Pick a number:" partialTriggers="buttonId" value="#{launchDialog.input}" /> <!-- The button for launching the dialog: we've also configured the width and height of that window --> <tr:commandButton text="Add" action="dialog:chooseInteger" id="buttonId" windowWidth="300" windowHeight="200" partialSubmit="true" useWindow="true" returnListener="#{launchDialog.returned}" /> </tr:form> </tr:document> </f:view> </jsp:root> Here is the associated managed bean LaunchDialogBean.java: package jsfpkg; import org.apache.myfaces.trinidad.component.UIXInput; import org.apache.myfaces.trinidad.event.ReturnEvent; public class LaunchDialogBean { private UIXInput _input; public UIXInput getInput() { return _input; } public void setInput(UIXInput input) { _input = input; } public void returned(ReturnEvent event) { if (event.getReturnValue() != null) { getInput().setSubmittedValue(null); getInput().setValue(event.getReturnValue()); } } } Here is the popup file Popup.jspx: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:trh="http://myfaces.apache.org/trinidad/html" xmlns:tr="http://myfaces.apache.org/trinidad" version="2.0"> <jsp:directive.page contentType="text/html;charset=utf-8" /> <f:view> <tr:document title="Add dialog"> <tr:form> <!-- Two input fields --> <tr:panelForm> <tr:inputText label="Number 1:" value="#{chooseInteger.value1}" required="true" /> <tr:inputText label="Number 2:" value="#{chooseInteger.value2}" required="true" /> </tr:panelForm> <!-- Two buttons --> <tr:panelGroup layout="horizontal"> <tr:commandButton text="Submit" action="#{chooseInteger.select}" /> <tr:commandButton text="Cancel" immediate="true" action="#{chooseInteger.cancel}" /> </tr:panelGroup> </tr:form> </tr:document> </f:view> </jsp:root> For that I have written the bean ChooseIntegerBean.java package jsfpkg; import org.apache.myfaces.trinidad.context.RequestContext; public class ChooseIntegerBean { private Integer _value1; private Integer _value2; public Integer getValue1() { return _value1; } public void setValue1(Integer value1) { _value1 = value1; } public Integer getValue2() { return _value2; } public void setValue2(Integer value2) { _value2 = value2; } public String cancel() { RequestContext.getCurrentInstance().returnFromDialog(null, null); return null; } public String select() { Integer value = new Integer(getValue1().intValue() + getValue2().intValue()); RequestContext.getCurrentInstance().returnFromDialog(value, null); return null; } } Here is my faces-config.xml: <managed-bean> <managed-bean-name>chooseInteger</managed-bean-name> <managed-bean-class>jsfpkg.ChooseIntegerBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>launchDialog</managed-bean-name> <managed-bean-class>jsfpkg.LaunchDialogBean</managed-bean-class> <managed-bean-scope> request </managed-bean-scope> </managed-bean> <navigation-rule> <from-view-id>/dialogdemo.jspx</from-view-id> <navigation-case> <from-outcome>dialog:chooseInteger</from-outcome> <to-view-id>/dialogbox.jspx</to-view-id> </navigation-case> </navigation-rule>

    Read the article

  • [PHP] missing keys in $_POST

    - by KPL
    Hello there, I am trying to get some form data from POST method. Here's the code of form - <form action="" method="post" name="form1" id="form1"> <input type="hidden" value="15" name="ad_id"> <table width="100%" cellspacing="0" cellpadding="0" border="0" class="block"> <tbody><tr> <td valign="top">&nbsp;</td> <td align="right">all fields are required</td> </tr> <tr> <td valign="top">&nbsp;</td> <td align="center"></td> </tr> <tr> <td valign="top" width="150"><label for="name">Advertisement Name</label> *</td> <td><input type="text" size="45" value="Banner" id="name" name="name"> e.g Home Banner</td> </tr> <tr> <td valign="top"><label for="placement">Advertisement Placement</label></td> <td><select id="placement" name="placement"> Wide Skyscrapper 160 x 600 </tr> <tr> <td valign="top"><label for="code">Advertisement Code</label></td> <td><textarea rows="5" cols="45" id="code" name="code"></textarea></td> </tr> <tr> <td>Status</td> <td><label> <input type="radio" checked="checked" value="1" name="status"> Active</label> <label> <input type="radio" value="0" name="status"> Inactive</label></td> </tr> <input type="hidden" value="1" name="banner_uploaded" id="banner_uploaded"> <tr> <td>For Country - </td> <td> <select id="country" name="country"> <option>Not posting all the names of country</option> </select> </td> </tr> <tr> <td><label for="Scheduling">Valid From </label></td> <td><input type="text" value="" id="date-from" name="date-from"> Format : dd/mm/yyyy:hh/mm</td> </tr> <tr> <td><label for="Scheduling">Valid Till </label></td> <td><input type="text" value="" id="date-to" name="date-to"> Format : dd/mm/yyyy:hh/mm</td> </tr> <tr> <td>&nbsp;</td> <td align="right"><input type="submit" onclick="return validate_ad_form(add_adv)" value="Update Advertisement" class="button" name="update"></td> </tr> </tbody></table> </form> But I am getting $_POST['code'] empty when I am passing HTML code through it. When I pass plain text, it works fine. When I printed $_POST [i.e. used - print_r($_POST) ], I got the following output - Array ( [ad_id] = 15 [name] = Banner [placement] = ad_468x60 [code] = [status] = 1 [banner_uploaded] = 1 [country] = IN [date-from] = [date-to] = [update] = Update Advertisement ) Please be known, I haven't entered the 'date-from','date-to' fields. I have entered on purpose as StackOverflow don't allow me to post images! People,any help will be highly appreciated.

    Read the article

  • on click checkbox set input attr

    - by Tommy Arnold
    html form with 4 columns the first 2 columns are the sizes inside input boxes with disabled ='disabled', when they click radio button to select a size a checkbox appears, when they click that checkbox I would like to change the class and disabled attr of the inputs on that table row to allow them to edit the input box <table width="388" border="1" id="product1"> <tr> <td width="100">Width</td> <td width="100">Height</td> <td width="48">Price</td> <td width="65">Select</td> </tr> <tr> <td><input type="text" disabled='disabled'value="200"/><span> CMS</span></td> <td><input disabled='disabled'type="text" value="500"/><span> CMS</span></td> <td>£50.00</td> <td><input type="radio" name="product1" value="size1" /> Customise<input type="checkbox" name="custom[size1]" class="custombox" value="1"/></td> </tr> <tr> <td>200</td> <td>1000</td> <td>£100.00</td> <td><input type="radio" name="product1" value="size2" /> Customise<input disabled='disabled' type="checkbox" name="custom[size2]" class="custombox" value="1"/></td> </tr> <tr> <td>200</td> <td>1500</td> <td>£150</td> <td><input type="radio" name="product1" value="size3" /> Customise<input type="checkbox" name="custom[size3]" class="custombox" value="1"/></td> </tr> </table> <table width="288" border="1" id="product2"> <tr> <td width="72">Width</td> <td width="75">Height</td> <td width="48">Price</td> <td width="65">&nbsp;</td> </tr> <tr> <td>200</td> <td>500</td> <td>£50.00</td> <td><input type="radio" name="product2" value="size1" /> Customise<input type="checkbox" name="custom[size1]" class="custombox" value="1"/></td> </tr> <tr> <td>200</td> <td>1000</td> <td>£100.00</td> <td><input type="radio" name="product2" value="size2" /> Customise<input type="checkbox" name="custom[size2]" class="custombox" value="1"/></td> </tr> <tr> <td>200</td> <td>1500</td> <td>£150</td> <td><input type="radio" name="product2" value="size3" /> Customise<input type="checkbox" name="custom[size3]" class="custombox" value="1"/></td> </tr> <table> CSS input[type=checkbox] { display: none; } input[type=checkbox].shown { display: inline; } input .edit{ border:1px solid red; } input[disabled='disabled'] { border:0px; width:60px; padding:5px; float:left; background:#fff; } span{float:left; width:30px; padding:5px;} Jquery $("body :checkbox").hide(); // The most obvious way is to set radio-button click handlers for each table separatly: $("#product1 :radio").click(function() { $("#product1 :checkbox").hide(); $("#product1 .cbox").hide(); $(this).parent().children(":checkbox").show(); $(this).parent().children(".cbox").show(); }); $("#product2 :radio").click(function() { $("#product2 :checkbox").hide(); $("#product2 .cbox").hide(); $(this).parent().children(":checkbox").show(); $(this).parent().children(".cbox").show(); }); This is what I thought but its not working $("#product1 :checkbox").click(function(){ $(this).parent("tr").children("td :input").attr('disabled',''); $(this).parent("tr").children("td :input").toggleClass(edit); }); $("#product2 :checkbox").click(function(){ $(this).parent("tr").children("td :input").attr('disabled',''); $(this).parent("tr").children("td :input").toggleClass(edit); }); Thanks in advance for any help.

    Read the article

  • Making invisible table rows visible one by one

    - by Roland
    I have the following situation I have a couple of table rows within a table eg <tr><td>One</td></tr> <tr><td>Two</td></tr> <tr><td>Three</td></tr> <tr><td>Four</td></tr> <tr><td>Five</td></tr> Say all of them are invisible Then I have a button to make them visible one by one, so if row 1 is invisible and I press the button then row 1 should be visible, if I press it again it sees that row 1 is already visible then it makes row 2 visible and so it goes on and on and on. How can I do this in Jquery so that jquery can accomplish this task for me. Is it possible?

    Read the article

  • How to Add Horizontal line in Javascript

    - by user54197
    I would like to add a horizontal seperating line on a dynamic populated table. How do I do this? Below is a snippet. function addNewRow() { $('#displayTable tr:last').after('<tr><td style="font-size:smaller;" class="dataField1"></td><td style="font-size:smaller;" class="dataField2"></td><td style="font-size:smaller;" class="dataField3"></td></tr>'); var $tr = $('#displayTable tr:last'); $tr.find('.dataField1').text($('#txtName').val()); $tr.find('.dataField2').text($('#txtAddress').val()); $tr.find('.dataField3').text('document.write("<tr><td colspan=\"2\"><hr \/><\/td><\/tr>"); }

    Read the article

  • jQuery: How to get the first “td” in all rows

    - by bobby
    I have a table, and I want get the first “td” in all rows. My jquery here: $("table.SimpleTable tr td:first-child").css('background-color','red'); and my HTML here: <table class='SimpleTable' border="1" ID="Table1"> <tr> <td>Left</td> <td>Right</td> </tr> <tr> <td>Left</td> <td>Right</td> </tr> <tr> <td>Left</td> <td>Right</td> </tr> <tr> <td>Left</td> <td> <table border="1" ID="Table2"> <tr> <td>AAA</td> <td>AAA</td> <td>AAA</td> </tr> </table> </td> </tr> <tr> <td>Left</td> <td> <table border="1" ID="Table3"> <tr> <td>BBB</td> <td>BBB</td> <td>BBB</td> </tr> </table> </td> </tr> </table> The problem here it get the first "td" in the nested table of the second "td". Please help me!

    Read the article

  • Smarty Tag help [closed]

    - by ntechi
    I am using an engine, where for forums Vbulletin is used and for Other thiiings social engine 3 is used, This was done by some professionals In one of the page I am having popular tags(In Social Engine) Its too long I want shortened it, How can I do it? here is my code {* SHOW POPULAR TAGS START *} <tr> <td align="left" valign="top"><img src="images/spacer.gif" alt="" width="1" height="10" /></td> </tr> <tr> <td align="left" valign="top"><table width="220" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="12" align="left" valign="top"><img src="images/blog_belowtl.jpg" alt="" width="12" height="10" /></td> <td width="196" align="left" valign="top" background="images/blog_belowtbg.jpg"><img src="images/spacer.gif" width="1" height="10" /></td> <td width="12" align="right" valign="top"><img src="images/blog_belowtr.jpg" alt="" width="12" height="10" /></td> </tr> <tr> <td align="left" valign="top" background="images/blog_belowlbg.jpg" style="background-repeat: repeat-y;">&nbsp;</td> <td align="left" valign="top"><table width="196" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td align="left" valign="top" > {*<div class="articletags" > {foreach from=$popular_tags item=poptag} <a class="tag{$poptag.class}" href="articles.php?tag={$poptag.name}">{$poptag.name}</a> {/foreach} </div>*} {foreach from=$popular_tags item=poptag} {if $poptag.count == '1' } {assign var=cssClass value='tahoma15_cloud'} {elseif $poptag.count == '2' } {assign var=cssClass value='tahoma12bold_cloud'} {elseif $poptag.count == '3'} {assign var=cssClass value='tahoma13bold_cloud'} {elseif $poptag.count == '4'} {assign var=cssClass value='tahoma14bold_cloud'} {elseif $poptag.count == '5'} {assign var=cssClass value='tahoma15_cloud'} {else} {assign var=cssClass value='tahoma18bold_cloud'} {/if} <span class="{$cssClass}"><a href="articles.php?tag={$poptag.name}" class="{$cssClass}">{$poptag.name}</a></span> {/foreach} </td> </tr> </table></td> <td align="left" valign="top" background="images/blog_belowrbg.jpg" style="background-repeat: repeat-y;">&nbsp;</td> </tr> <tr> <td align="left" valign="top"><img src="images/blog_belowbl.jpg" alt="" width="12" height="10" /></td> <td align="left" valign="top" background="images/blog_belowbbg.jpg"><img src="images/spacer.gif" alt="" width="1" height="10" /></td> <td align="right" valign="top"><img src="images/blog_belowbr.jpg" alt="" width="12" height="10" /></td> </tr> </table></td> </tr> {* SHOW POPULAR TAGS END *} You can check the lenght of this tag, on this link http://www.managementparadise.com/articles.php Currently it is displaying very long on the widget area I am new on this, so any help will be appreciated :)

    Read the article

  • Styling specific columns and rows

    - by hattenn
    I'm trying to style some specific parts of a 5x4 table that I create. It should be like this: Every even numbered row and every odd numbered row should get a different color. Text in the second, third, and fourth columns should be centered. I have this table: <table> <caption>Some caption</caption> <colgroup> <col> <col class="value"> <col class="value"> <col class="value"> </colgroup> <thead> <tr> <th id="year">Year</th> <th>1999</th> <th>2000</th> <th>2001</th> </tr> </thead> <tbody> <tr class="oddLine"> <td>Berlin</td> <td>3,3</td> <td>1,9</td> <td>2,3</td> </tr> <tr class="evenLine"> <td>Hamburg</td> <td>1,5</td> <td>1,3</td> <td>2,0</td> </tr> <tr class="oddLine"> <td>München</td> <td>0,6</td> <td>1,1</td> <td>1,0</td> </tr> <tr class="evenLine"> <td>Frankfurt</td> <td>1,3</td> <td>1,6</td> <td>1,9</td> </tr> </tbody> <tfoot> <tr class="oddLine"> <td>Total</td> <td>6,7</td> <td>5,9</td> <td>7,2</td> </tr> </tfoot> </table> And I have this CSS file: table, th, td { border: 1px solid black; border-collapse: collapse; padding: 0px 5px; } #year { text-align: left; } .oddLine { background-color: #DDDDDD; } .evenLine { background-color: #BBBBBB; } .value { text-align: center; } And this doesn't work. The text in the columns are not centered. What is the problem here? And is there a way to solve it (other than changing the class of all the cells that I want centered)? P.S.: I think there's some interference with .evenLine and .oddLine classes. Because when I put "background: black" in the class "value", it changes the background color of the columns in the first row. The thing is, if I delete those two classes, text-align still doesn't work, but background attribute works perfectly. Argh...

    Read the article

  • ASP.NET MVC Validations

    - by Pinu
    I need to validate the Advanced search form , but it has data to be sent to 2 different table people and documents so i am unable to use data annotations. I need to validate the Name to be characters only, account number & amount to be a number.How can i validate these fields? <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <center> <img src="../../Content/images/DocuVault_Logo.png" alt="DocuVault" /> <%= Html.ValidationSummary() %> <% using (Html.BeginForm("QuickSearch", "Search")) { %> <div id="div_QuickSearch"> <table> <tr> <td colspan="2"> <%= Html.TextBox("search", "", new { style = "width: 300px" })%> <input type="submit" value="Search" /> </td> </tr> <tr> <td colspan="2"> <%= Html.ValidationMessage("search") %> </td> </tr> <tr> <td><a href="#" id="link_advanced">Advanced Search</a></td> </tr> </table> <br /> </div> <% } %> <ul> </ul> </div> <% using (Html.BeginForm("AdvancedSearch", "Search")) { %> <div id="div_AdvancedSearch" style="display: none; width: 420px; padding: 10px;"> People <table style="border: solid 1px black; padding: 5px; width: 400px;"> <tr> <td>Name:</td> <td align="right"> <%= Html.TextBox("searchName") %> <%= Html.ValidationMessage("searchName")%> </td> </tr> <tr> <td>Address:</td> <td align="right"> <%= Html.TextBox("searchAddress") %> <%= Html.ValidationMessage("searchAddress")%> </td> </tr> <tr> <td>Account Number:</td> <td align="right"> <%= Html.TextBox("searchAccountNumber") %> <%= Html.ValidationMessage("searchAccountNumber")%> </td> </tr> </table> <br /> Documents <table style="border: solid 1px black; padding: 5px; width: 400px;"> <tr> <td>Invoice:</td> <td align="right"> <%= Html.TextBox("searchInvoice") %> <%= Html.ValidationMessage("searchInvoice")%> </td> </tr> <tr> <td>Amount:</td> <td align="right"> <%= Html.TextBox("searchAmount") %> <%= Html.ValidationMessage("searchAmount")%> </td> </tr> <tr> <td>Job:</td> <td align="right"> <%= Html.TextBox("searchJob") %> <%= Html.ValidationMessage("searchJob")%> </td> </tr> <tr> <td>SDI:</td> <td align="right"> <%= Html.TextBox("searchSDI") %> <%= Html.ValidationMessage("searchSDI")%> </td> </tr> <tr> <td>Date:</td> <td align="right"> <%= Html.TextBox("searchDateBegin", "", new { style = "width: 88px" })%> to <%= Html.TextBox("searchDateEnd", "", new { style = "width: 88px" })%> <%= Html.ValidationMessage("searchDate")%> </td> </tr> </table> <br /> <div style="width: 100%;"> <span style="float: left; margin-left: 10px;"><a href="#" id="link_quick">QuickSearch</a></span> <span style="float: right; margin-right: 10px;"><input type="submit" value="Advanced Search" /></span> </div> </div> <% } %> </center> </asp:Content>

    Read the article

  • Open XML SDK 2.0 - Split table to new power point slide when content flows off current slide

    - by amurra
    I have a bunch of data that I need to export from a website to a power point presentation and have been using Open XML SDK 2.0 to perform this task. I have a power point presentation that I am putting through Open XML SDK 2.0 Productivity Tool to generate the template code that I can use to recreate the export. On one of those slides I have a table and the requirement is to add data to that table and break that table across multiple slides if the table exceeds the bottom of the slide. The approach I have taken is to determine the height of the table and if it exceeds the height of the slide, move that new content into the next slide. I have read Bryan and Jones blog on adding repeating data to a power point slide, but my scenario is a little different. They use the following code: A.Table tbl = current.Slide.Descendants<A.Table>().First(); A.TableRow tr = new A.TableRow(); tr.Height = heightInEmu; tr.Append(CreateDrawingCell(imageRel + imageRelId)); tr.Append(CreateTextCell(category)); tr.Append(CreateTextCell(subcategory)); tr.Append(CreateTextCell(model)); tr.Append(CreateTextCell(price.ToString())); tbl.Append(tr); imageRelId++; This won't work for me since they know what height to set the table row to since it will be the height of the image, but when adding in different amounts of text I do not know the height ahead of time so I just set tr.Heightto a default value. Here is my attempt at figuring at the table height: A.Table tbl = tableSlide.Slide.Descendants<A.Table>().First(); A.TableRow tr = new A.TableRow(); tr.Height = 370840L; tr.Append(PowerPointUtilities.CreateTextCell("This"); tr.Append(PowerPointUtilities.CreateTextCell("is")); tr.Append(PowerPointUtilities.CreateTextCell("a")); tr.Append(PowerPointUtilities.CreateTextCell("test")); tr.Append(PowerPointUtilities.CreateTextCell("Test")); tbl.Append(tr); tableSlide.Slide.Save(); long tableHeight = PowerPointUtilities.TableHeight(tbl); Here are the helper methods: public static A.TableCell CreateTextCell(string text) { A.TableCell tableCell = new A.TableCell( new A.TextBody(new A.BodyProperties(), new A.Paragraph(new A.Run(new A.Text(text)))), new A.TableCellProperties()); return tableCell; } public static Int64Value TableHeight(A.Table table) { long height = 0; foreach (var row in table.Descendants<A.TableRow>() .Where(h => h.Height.HasValue)) { height += row.Height.Value; } return height; } This correctly adds the new table row to the existing table, but when I try and get the height of the table, it returns the original height and not the new height. The new height meaning the default height I initially set and not the height after a large amount of text has been inserted. It seems the height only gets readjusted when it is opened in power point. I have also tried accessing the height of the largest table cell in the row, but can't seem to find the right property to perform that task. My question is how do you determine the height of a dynamically added table row since it doesn't seem to update the height of the row until it is opened in power point? Any other ways to determine when to split content to another slide while using Open XML SDK 2.0? I'm open to any suggestion on a better approach someone might have taken since there isn't much documentation on this subject.

    Read the article

  • Ensuring a divs content has changed over time in Selenium

    - by Stewart Robinson
    I have a div that contains a slideshow. ( http://film.robinhoodtax.org/issues/education ) I am using Selenium to test it. So far I have been using the HTML/Selenium script below to validate that the slideshow is actually working. But my assertEval is failing. How can I correctly detect the slideshow and make sure it is moving?. You can see I've approached this by storing the HTML and waiting then trying again but it isn't working. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="selenium.base" href="" /> <title>New Test</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> <tr><td rowspan="1" colspan="3">New Test</td></tr> </thead><tbody> <tr> <td>open</td> <td>/issues/education</td> <td></td> </tr> <tr> <td>waitForPageToLoad</td> <td></td> <td></td> </tr> <tr> <td>assertElementPresent</td> <td>css=div[id='views-nivo-slider-ImagesGallery-block_1']</td> <td></td> </tr> <tr> <td>storeHtmlSource</td> <td>css=div[id='views-nivo-slider-ImagesGallery-block_1']</td> <td>first</td> </tr> <tr> <td>pause</td> <td>3000</td> <td></td> </tr> <tr> <td>storeHtmlSource</td> <td>css=div[id='views-nivo-slider-ImagesGallery-block_1']</td> <td>second</td> </tr> <tr> <td>assertEval</td> <td>${first} == ${second}</td> <td>second</td> </tr> </tbody></table> </body> </html>

    Read the article

  • alternative in .Net to building Tables/TR/TD manually?

    - by egrunin
    I've got a pile of code here that looks like this: if (stateTax > 0) { tr = new TableRow(); tbl.Rows.Add(tr); td = new TableCell(); td.CssClass = "stdLabel"; td.Text = "NY State Tax"; tr.Cells.Add(td); td = new TableCell(); td.Text = string.Format("{0:C}", stateTax); td.CssClass = "justRight"; tr.Cells.Add(td); } This is a horrible hash of data and layout, but creating a special class or control every time something like this comes up seems almost as bad. What I usually do is write a helper function, which is concise but ugly: if (stateTax > 0) MakeRow(tbl, "NY State Tax", "stdLabel", string.Format("{0:C}", stateTax), "justRight"); And now I'm thinking: haven't I done this 100 times before? Isn't there a more modern way? Just to be explicit: it's a whole list of miscellaneous labels and values. They don't come from any particular data source, and the rules for when rows should be suppressed vary. This example has only two columns, but I have other places with more.

    Read the article

  • Parse html and find data in the html

    - by Dan.StackOverflow
    Hi all. I am trying to use html5lib to parse an html page in to something I can query with xpath. html5lib has close to zero documentation and I've spent too much time trying to figure this problem out. Ultimate goal is to pull out the second row of a table: <html> <table> <tr><td>Header</td></tr> <tr><td>Want This</td></tr> </table> </html> so lets try it: >>> doc = html5lib.parse('<html><table><tr><td>Header</td></tr><tr><td>Want This</td> </tr></table></html>', treebuilder='lxml') >>> doc <lxml.etree._ElementTree object at 0x1a1c290> that looks good, lets see what else we have: >>> root = doc.getroot() >>> print(lxml.etree.tostring(root)) <html:html xmlns:html="http://www.w3.org/1999/xhtml"><html:head/><html:body><html:table><html:tbody><html:tr><html:td>Header</html:td></html:tr><html:tr><html:td>Want This</html:td></html:tr></html:tbody></html:table></html:body></html:html> LOL WUT? seriously. I was planning on using some xpath to get at the data I want, but that doesn't seem to work. So what can I do? I am willing to try different libraries and approaches.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >