Posts

Showing posts with the label html-table

How do I keep two side-by-side divs the same height?

Image
How do I keep two side-by-side divs the same height? I have two divs side by side. I'd like the height of them to be the same, and stay the same if one of them resizes. I can't figure this one out though. Ideas? To clarify my confusing question, I'd like both boxes to always be the same size, so if one grows because text is placed into it, the other one should grow to match the height. Some content! Some content! Some content! Some content! Some content! Some content! </div> How did you put them "side by side"? Using float ? – MvanGeest Jun 8 '10 at 13:41 float Do you want that if one of them is getting bigger, than the other one will stay the same height size? – Wai Wong Jun 8 '...

Find the 2nd td of every table and push it into array

Find the 2nd td of every table and push it into array I have this HTML table : var code = ; var pname = ; var description = ; var size = ; var printarea = ; var colours = ; var comments = ; var cell = document.getElementsByTagName("td"); for (var i = 1; i < cell.length; i += 14) { var c = cell[i].innerHTML; code.push(c); } console.log(code); console.log(pname); // code = VISA01, UMBR21 // name = Sun Viscor Clip, Compact Umbrella With Steel Shaft // description = Stylish Sun Visor Clip which holds your sunglasses in place and within reachProtects your sunglasses away from being scratchedEasy to use, sturdy, clips well and does not block your vision while driving SIZE 8 (w) x 3 (h) cm, Compact umbrella with steel shaft for a strong wind-resistant performancePush button and auto-open for a convenient and effortless openingDurable Logo printed on front and back panels; comes in several colors; can combine colors upon request <html> <head> <title>Table ...

JQuery Swap Column

JQuery Swap Column I need to swap the column in a table but retain the current edit value of the column. Here is my code: $(this).click(function () { var $td = $(this).closest('td.container'); var $tds = ; $td.closest('tr').children('td').each(function () { $tds.push($(this)); }); for (var i = $td.index() + 1; i < $tds.length; i++) $tds[i - 1].html($tds[i].html()).addClass('border'); $tds[$tds.length - 1].html('').removeClass('border'); }); However, if I have textboxes and editing the textboxes when swapping the column, the textbox values will disappear. Here is the jsfiddle. Step to reproduce: 1. Enter some text in textbox in column #3 2. Click on "Delete Button" in column #2 3. You will see the text entered in step #1 will disappear. Any idea how to tackle this problem? 1 Answer 1 The issue is because you'...

Compare values of cells in different rows in table using PHP

Compare values of cells in different rows in table using PHP My question is similar to the one found here: compare values of cells in different rows in table using jquery Using PHP, what is the best way to group together rows and cells - if the value in the first column and the value of the 3rd columns are the the same, while maintaining the zebra-stripe pattern? This is what I'm trying to do: http://jsfiddle.net/zmcjwqk9/ <table border="1"> <thead> <tr> <td>TITLE A</td> <td>TITLE B</td> <td>TITLE C</td> </tr> </thead> <tbody> <tr style="background-color: yellow"> <td>A</td> <td>B</td> <td>C</td> </tr> <tr style="background-color: red"> <td>AA</td> <td>BB</td> <td>CC</td> </tr> <tr styl...