Search Results

Search found 24890 results on 996 pages for 'pivot table'.

Page 15/996 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • dynamically insert new rows in the table (JavaScript) ?

    - by Karandeep Singh
    <script type="text/javascript" language="javascript"> function addNewRow() { var table = document.getElementById("table1"); var tr = table.insertRow(); var td = tr.insertCell(); td.innerHTML= "a"; td = tr.insertCell(); td.innerHTML= "b"; td = tr.insertCell(); td.innerHTML= "c"; td = tr.insertCell(); td.innerHTML= "d"; td = tr.insertCell(); td.innerHTML= "e"; } </script> <body> <table id="table1" border="1" cellpadding="0" cellspacing="0" width="100%"> <tr id="row1"> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> </tr> </table> <input type="button" onClick="addNewRow()" value="Add New"/> </body> This example is for dynamically insert new row and cells in the table. But its behavior is different in all browsers. Internet Explorer = It add row in the last and new added cells are starts from first. Chrome/Safari = It add new row in the first and new added cells are starts from end. Mozilla Firefox = It is not working. Sir, I want new added row in the last and new added cells starts from first like(Interner Explorer) in all browsers. If you have any solution for same behavior please tell me. Thanks,

    Read the article

  • Hyperlinks within a table - '<a href="">'.$row['username'].'</a>'

    - by Taimur
    Hi, I have made a leaderboard table on my site, which returns the users in the MySQL database with the highest scores (score is a separate field). The fields in the leaderboard table are 'rank' 'username' and 'score'. I would like to link each username in the table to it's own profile page. The profile pages are in the format /profile.php?user=$username. How would I go about adding an <a href> within the table (which is echoed in php): echo '<tr><td>' .$a. '</td><td><a href="profile.php?user=' .$row['username']. '">' .$row['username']. '</a></td><td>'.$row['count'].'</td></tr>'; I've tried the above, but it doesn't seem to work. It shows the usernames, but they don't have any hyperlinks. Thanks

    Read the article

  • database table design

    - by e.b.white
    I design the tables as below for the system which looks like a package delivering system For example, after user received the package, postman should record in system, and the state(history table) is "delivered",and operator is this postman, the current state(state table) is of course "delivered" history table: +---------------+--------------------------+ | Field | Desc | +---------------+--------------------------+ | id | PRIMARY KEY | +---------------+--------------------------+ | package_id | package_tacking_id | +---------------+--------------------------+ | state | package_state | +---------------+--------------------------+ | operators | operators | +---------------+--------------------------+ | create_time| create_time | +---------------+--------------------------+ state table: +---------------+--------------------------+ | Field | Desc | +---------------+--------------------------+ | id | PRIMARY KEY | +---------------+--------------------------+ | package_id | package_tacking_id | +---------------+--------------------------+ | state | latest_package_state | +---------------+--------------------------+ Above is just the basic information to record, some other information( like invoice, destination,...) should be recored as well. But there are different service types like s1 and s2, for s1 it is not needed to record invoice but s1 need, and maybe s1 need some other information to record (like the tel of end user). After all, at delivering way stations there are additional information to record, and for different service type the information type is different. My question is: 1. For different service type, shall I need to declare different tables(option A) or just one big table which can record all information for all types(option B)? 2. If option A, since the basic information above is MUST, how can prevent from declaring there duplicate fields in different tables?

    Read the article

  • Help getting the following create table function to work with mysql and C#

    - by Matt
    string createTable = "CREATE TABLE IF NOT EXISTS " + m_strDatabase + "_TimeLogs (logName VARCHAR(16), logTime INTEGER, logCountry TEXT, UNIQUE(logName)) TYPE=MyISAM;"; When this runs, no table is created. No errors either. Im using an ODBC connector. the variable passes in the db name, so that the table created would be users_TimeLogs if the database was called users for example. Am I doing something wrong?

    Read the article

  • Change master table PK and update related table FK (changing PK from Autoincrement to UUID on Mysql)

    - by eleonzx
    I have two related tables: Groups and Clients. Clients belongs to Groups so I have a foreign key "group_id" that references the group a client belongs to. I'm changing the Group id from an autoincrement to a UUID. So what I need is to generate a UUID for each Group and update the Clients table at once to reflect the changes and keep the records related. Is there a way to do this with multiple-table update on MySQL? Adding tables definitions for clarification. CREATE TABLE `groups` ( `id` char(36) NOT NULL, `name` varchar(255) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$ CREATE TABLE `clients` ( `id` char(36) NOT NULL, `name` varchar(255) NOT NULL, `group_id` char(36) DEFAULT NULL, `active` tinyint(1) DEFAULT '1' PRIMARY KEY (`id`), KEY `fkgp` (`group_id`), CONSTRAINT `fkgp` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$

    Read the article

  • getting parameter value from a table using javascript

    - by kawtousse
    hi every one; I want to get the parameter in my table(HTLML) table every time the user click edit button. The table contains in each row an edit button like following: retour.append("<td>"); retour.append("<button id=edit name=edit type=button onClick= editarow()>"); retour.append("<img src=edit.gif />"); retour.append("</button>"); retour.append("</td>"); to get the value of each row where edit is clicked using javascript I do the following: function editarow(){ var table = document.getElementById("sheet"); var buttons = table.getElementsByTagName("button"); for(var i=0; i<buttons.length; i++) { if(buttons[i].name=="edit") { buttons[i].onclick = function() { var buttonCell = this.parentNode;//cell var editThisRow = buttonCell.parentNode;//td var er=editThisRow.parentNode.attributes[1].value; alert(er); } } } } but i didn't get the values expected. thanks for help

    Read the article

  • problem with the table width in IE?

    - by Harish Kurup
    I am using table to display a set of data, my HTML code goes here... <table border="1" cellspacing="0" cellpadding="0" style="width: 780px;"> <tbody> <tr> <td style="width: 780px; height: 25px;"> <pre width='100' style='width: 780px; word-wrap: break-word;'> the data goes here..... </pre> </td> </tr> <tr> <td style="width: 780px; height: 25px;"> <pre width='100' style='width: 780px; word-wrap: break-word;'> the data goes here..... </pre> </td> </tr> </tbody> </table> this table works ok in firefox, safari, and IE8. But the problem arise in IE7, IE6.. asthe table expands and goes out of the screen(i.e expands towards right hand side in x-axis).... is there any hack to fix it?

    Read the article

  • Change row table color with javaScript

    - by Slim Mils
    I try to change the background of rows in my table with javaScript but it's not working. This is my code. However I tried to create my table with html and it's work. P.S : I want to use webkit. Help please. Code : var table = document.getElementById("tab"); var rowCount = table.rows.length; for(var i=0;i<6;i++) { row = table.insertRow(rowCount); row.id = "row"+i; cell1 = row.insertCell(0); var content = document.createElement("output"); content.innerHTML = i ; cell1.appendChild(content); rowCount++; } $(document).ready(function(){ $('td').each(function(i) { $('#tab').on('click', '#row'+i, function(){ document.getElementById("row"+i).style.background = 'white'; //alert(i); }); }); //example2 $('#td1').on('click', function(){ document.getElementById("td1").style.background = 'white'; }); });

    Read the article

  • Recursive CTE with alternating tables

    - by SOfanatic
    I've created a SQL fiddle here. Basically, I have 3 tables BaseTable, Files, and a LinkingTable. The Files table has 3 columns: PK, BaseTableId, RecursiveId (ChildId). What I want to do is find all the children given a BaseTableId (i.e., ParentId). The tricky part is that the way the children are found works like this: Take ParentId 1 and use that to look up a FileId in the Files table, then use that FileId to look for a ChildId in the LinkingTable, if that record exists then use the RecursiveId in the LinkingTable to look for the next FileId in the Files table and so on. This is my CTE so far: with CTE as ( select lt.FileId, lt.RecursiveId, 0 as [level], bt.BaseTableId from BaseTable bt join Files f on bt.BaseTableId = f.BaseTableId join LinkingTable lt on f.FileId = lt.FileId where bt.BaseTableId = @Id UNION ALL select rlt.FileId, rlt.RecursiveId, [level] + 1 as [level], CTE.BaseTableId from CTE --??? and this is where I get lost ... ) A correct output for BaseTableId = 1, should be: FileId|RecursiveId|level|BaseTableId 1 1 0 1 3 2 1 1 4 3 2 1

    Read the article

  • How to link to an Excel pivot table that will expand over time in Word 2007?

    - by Daljit Dhadwal
    I have a pivot table in Excel 2007 which I’ve pasted it into Word 2007 using Paste Special (Paste link) - Microsoft Office Excel Worksheet Object. The pivot table appears in Word and the link to Excel is working. The problem is that if the pivot table expands (for example, due to showing 12 months of data rather than six months) the link to the pivot table in Word will only show the range cells that were originally copied over with the pivot table. I understand why this happens. When I paste as a link to Word the underling field codes look like this: {LINK Excel.Sheet.8 "C:\Users\myAccount\Documents\testexcel.xlsx" "Sheet2!R1C1:R8C2" \a \p} The codes refer to a fixed area (e.g., Sheet2!R1C1:R8C2 ) of the Excel spreadsheet, and so when the pivot table expands, the expanded cells fall outside the area that is defined in the field codes. Is there some way to have the link refer to the pivot table itself rather than the cell range that happened to be originally copied over from Excel?

    Read the article

  • Hide table row based on content of table cell

    - by timkl
    I want to make some jQuery that shows some table rows and hides others based on the content of the first table cell in each row. When I click a list item I want jQuery to check if the first letter of the item matches the first letter in any table cell in my markup, if so the parent table row should be shown and other rows should be hidden. This is my markup: <ul> <li>A</li> <li>B</li> <li>G</li> </ul> <table> <tr> <td>Alpha1</td> <td>Some content</td> </tr> <tr> <td>Alpha2</td> <td>Some content</td> </tr> <tr> <td>Alpha3</td> <td>Some content</td> </tr> <tr> <td>Beta1</td> <td>Some content</td> </tr> <tr> <td>Beta2</td> <td>Some content</td> </tr> <tr> <td>Beta3</td> <td>Some content</td> </tr> <tr> <td>Gamma1</td> <td>Some content</td> </tr> <tr> <td>Gamma2</td> <td>Some content</td> </tr> <tr> <td>Gamma3</td> <td>Some content</td> </tr> </table> So if I press "A" this is what is rendered in the browser: <ul> <li>A</li> <li>B</li> <li>G</li> </ul> <table> <tr> <td>Alpha1</td> <td>Some content</td> </tr> <tr> <td>Alpha2</td> <td>Some content</td> </tr> <tr> <td>Alpha3</td> <td>Some content</td> </tr> </table> I'm really new to jQuery so any hint on how to go about a problem like this would be appreciated :)

    Read the article

  • Can't change pivot table's Access data source - bug in Excel 2000 SP3?

    - by Ron West
    I have a set of Excel 2000 SP3 worksheets that have Pivot Tables that get data from an Access 2000 SP3 database created by a contractor who left our company. Unfortunately, he did all his work on his private area on the company (Novell) network and now that he has left us, the drive spec has been deleted and is invalid. We were able to get the database files restored to our network area by our IT Service Desk people, but we now have to re-link everything to point to our group area instead of the now-nonexistent private area. If I follow the advice given elsewhere on this site (open wizard, click 'Back' to get to 'Step 2 of 3', click 'Get Data...' I get a message that the old filespec is an invalid path and I need to check that the path name is invalid and that I am connected to the server on which the file resides. I then click on OK and get a Login dialog with a 'Database...' button on the right. I click this and get a 'Select Database' dialog which allows me to choose the appropriate database in its correct new location. I then click OK, which takes me back to the 'Login' screen. I can confirm that it has accepted my new location by clicking on 'Database...' as before and the NEW location is still shown. So far so good - but if I then click on OK I get two unhelpful messages - first I get one saying that Excel 'Could not use '|'; file already in use.' - although no other files are in use. Clicking on OK takes me back to the 'Login' dialog. Clicking OK again gives me the same message as before telling me that the OLD filespec is invalid (as if I hadn't changed anything) - but clicking on the 'Database...' button shows that the correct (NEW) database location is still selected. Can anyone tell me a way of using VBA to change the link information without having to spend hours fighting the PivotTable Wizard - preferably similar to this way you update an Access Tabledef:- db.TableDefs(strLinkName).Connect = strNewLink db.TableDefs(strLinkName).RefreshLink Thanks!

    Read the article

  • One table, need multiple values from different rows/tuples

    - by WmasterJ
    I have tables like: 'profile_values' userID | fid | value -------+---------+------- 1 | 3 | [email protected] 1 | 45 | 203-234-2345 3 | 3 | [email protected] 1 | 45 | 123-456-7890 And: 'users' userID | name -------+------- 1 | joe 2 | jane 3 | jake I want to join them and have one row with two of the values like: 'profile_values' userID | name | email | phone -------+-------+----------------+-------------- 1 | joe | [email protected] | 203-234-2345 2 | jane | [email protected] | 123-456-7890 I have solved it but it feels clumsy and I want to know if there is a better way to do it. Meaning solutions that are either more readable or faster(optimized) or simply best-practice. Current solution: multiple tables selected, many conditional statements: SELECT u.userID AS memberid, u.name AS first_name, pv1.value AS fname, pv2.value as lname FROM users AS u, profile_values AS pv1, profile_values AS pv2, WHERE u.userID = pv1.userID AND pv1.fid = 3 AND u.userID = pv2.userID AND pv2.fid = 45; Thanks for the help!

    Read the article

  • SQL Query for generating matrix like output querying related table in SQL Server

    - by Nagesh
    I have three tables: Product ProductID ProductName 1 Cycle 2 Scooter 3 Car Customer CustomerID CustomerName 101 Ronald 102 Michelle 103 Armstrong 104 Schmidt 105 Peterson Transactions TID ProductID CustomerID TranDate Amount 10001 1 101 01-Jan-11 25000.00 10002 2 101 02-Jan-11 98547.52 10003 1 102 03-Feb-11 15000.00 10004 3 102 07-Jan-11 36571.85 10005 2 105 09-Feb-11 82658.23 10006 2 104 10-Feb-11 54000.25 10007 3 103 20-Feb-11 80115.50 10008 3 104 22-Feb-11 45000.65 I have written a query to group the transactions like this: SELECT P.ProductName AS Product, C.CustName AS Customer, SUM(T.Amount) AS Amount FROM Transactions AS T INNER JOIN Product AS P ON T.ProductID = P.ProductID INNER JOIN Customer AS C ON T.CustomerID = C.CustomerID WHERE T.TranDate BETWEEN '2011-01-01' AND '2011-03-31' GROUP BY P.ProductName, C.CustName ORDER BY P.ProductName which gives the result like this: Product Customer Amount Car Armstrong 80115.50 Car Michelle 36571.85 Car Schmidt 45000.65 Cycle Michelle 15000.00 Cycle Ronald 25000.00 Scooter Peterson 82658.23 Scooter Ronald 98547.52 Scooter Schmidt 54000.25 I need result of query in MATRIX form like this: Customer |------------ Amounts --------------- Name |Car Cycle Scooter Totals Armstrong 80115.50 0.00 0.00 80115.50 Michelle 36571.85 15000.00 0.00 51571.85 Ronald 0.00 25000.00 98547.52 123547.52 Peterson 0.00 0.00 82658.23 82658.23 Schmidt 45000.65 0.00 54000.25 99000.90 Please help me to acheive the above result in SQL Server 2005. Using mulitple views or even temporory tables is fine for me.

    Read the article

  • How can I pivot these key+values rows into a table of complete entries?

    - by CodexArcanum
    Maybe I demand too much from SQL but I feel like this should be possible. I start with a list of key-value pairs, like this: '0:First, 1:Second, 2:Third, 3:Fourth' etc. I can split this up pretty easily with a two-step parse that gets me a table like: EntryNumber PairNumber Item 0 0 0 1 0 First 2 1 1 3 1 Second etc. Now, in the simple case of splitting the pairs into a pair of columns, it's fairly easy. I'm interested in the more advanced case where I might have multiple values per entry, like: '0:First:Fishing, 1:Second:Camping, 2:Third:Hiking' and such. In that generic case, I'd like to find a way to take my 3-column result table and somehow pivot it to have one row per entry and one column per value-part. So I want to turn this: EntryNumber PairNumber Item 0 0 0 1 0 First 2 0 Fishing 3 1 1 4 1 Second 5 1 Camping Into this: Entry [1] [2] [3] 0 0 First Fishing 1 1 Second Camping Is that just too much for SQL to handle, or is there a way? Pivots (even tricky dynamic pivots) seem like an answer, but I can't figure how to get that to work.

    Read the article

  • Update table rows in a non-sequential way using the output of a php script

    - by moviemaniac
    Good evening everybody, this is my very first question and I hope I've done my search in stack's archive at best!!! I need to monitor several devices by querying theyr mysql database and gather some informations. Then these informations are presented to the operator in an html table. I have wrote a php script wich loads devices from a multidimensional array, loops through the array and gather data and create the table. The table structure is the following: <table id="monitoring" class="rt cf"> <thead class="cf"> <tr> <th>Device</th> <th>Company</th> <th>Data1</th> <th>Data2</th> <th>Data3</th> <th>Data4</th> <th>Data5</th> <th>Data6</th> <th>Data7</th> <th>Data8</th> <th>Data9</th> </tr> </thead> <tbody> <tr id="Device1"> <td>Devide 1 name</td> <td>xx</td> <td><img src="/path_to_images/ajax_loader.gif" width="24px" /></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr id="Device2"> <td>Devide 1 name</td> <td>xx</td> <td><img src="/path_to_images/ajax_loader.gif" width="24px" /></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr id="DeviceN"> <td>Devide 1 name</td> <td>xx</td> <td><img src="/path_to_images/ajax_loader.gif" width="24px" /></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </tbody> </table> The above table is directly populated when I first load the page; then, with a very simple function, i update this table every minute without reloading the page: <script> var auto_refresh = setInterval( function() { jQuery("#monitoring").load('/overview.php').fadeIn("slow"); var UpdateTime= new Date(); var StrUpdateTime; StrUpdateTime= ('0' + UpdateTime.getHours()).slice(-2) + ':' + ('0' + UpdateTime.getMinutes()).slice(-2) + ':' + ('0' + UpdateTime.getSeconds()).slice(-2); jQuery("#progress").text("Updated on: " + StrUpdateTime); }, 60000); </script> The above code runs in a wordpress environment. It comes out that when devices are too much and internet connection is not that fast, the script times out, even if i dramatically increase the timeout period. So it is impossible even to load the page the first time... Therefore I would like to change my code so that I can handle each row as a single entity, with its own refresh period. So when the user first loads the page, he sees n rows (one per device) with the ajax loader image... then an update cycle should start independently for each row, so that the user sees data gathered from each database... then ajax loader when the script is trying to retrieve data, then the gathered data once it has been collected or an error message stating that it is not possible to gather data since hour xx:yy:zz. So rows updating should be somewhat independent from the others, like if each row updating was a single closed process. So that rows updating is not done sequentially from the first row to the last. I hope I've sufficiently detailed my problem. Currently I feel like I am at a dead-end. Could someone please show me somewhere to start from?

    Read the article

  • Using CTAS & Exchange Partition Replace IAS for Copying Partition on Exadata

    - by Bandari Huang
    Usage Scenario: Copy data&index from one partition to another partition in a partitioned table. Solution: Create a partition definition Copy data from one partition to another partiton by 'Insert as select (IAS)' Create a nonpartitioned table by 'Create table as select (CTAS)' Convert a nonpartitioned table into a partition of partitoned table by exchangng their data segments. Rebuild unusable index Exchange Partition Convertion Mutual convertion between a partition (or subpartition) and a nonpartitioned table Mutual convertion between a hash-partitioned table and a partition of a composite *-hash partitioned table Mutual convertiton a [range | list]-partitioned table into a partition of a composite *-[range | list] partitioned table. Exchange Partition Usage Scenario High-speed data loading of new, incremental data into an existing partitioned table in DW environment Exchanging old data partitions out of a partitioned table, the data is purged from the partitioned table without actually being deleted and can be archived separately Exchange Partition Syntax ALTER TABLE schema.table EXCHANGE [PARTITION|SUBPARTITION] [partition|subprtition] WITH TABLE schema.table [INCLUDE|EXCLUDING] INDEX [WITH|WITHOUT] VALIDATION UPDATE [INDEXES|GLOBAL INDEXES] INCLUDING | EXCLUDING INDEXES Specify INCLUDING INDEXES if you want local index partitions or subpartitions to be exchanged with the corresponding table index (for a nonpartitioned table) or local indexes (for a hash-partitioned table). Specify EXCLUDING INDEXES if you want all index partitions or subpartitions corresponding to the partition and all the regular indexes and index partitions on the exchanged table to be marked UNUSABLE. If you omit this clause, then the default is EXCLUDING INDEXES. WITH | WITHOUT VALIDATION Specify WITH VALIDATION if you want Oracle Database to return an error if any rows in the exchanged table do not map into partitions or subpartitions being exchanged. Specify WITHOUT VALIDATION if you do not want Oracle Database to check the proper mapping of rows in the exchanged table. If you omit this clause, then the default is WITH VALIDATION.  UPADATE INDEX|GLOBAL INDEX Unless you specify UPDATE INDEXES, the database marks UNUSABLE the global indexes or all global index partitions on the table whose partition is being exchanged. Global indexes or global index partitions on the table being exchanged remain invalidated. (You cannot use UPDATE INDEXES for index-organized tables. Use UPDATE GLOBAL INDEXES instead.) Exchanging Partitions&Subpartitions Notes Both tables involved in the exchange must have the same primary key, and no validated foreign keys can be referencing either of the tables unless the referenced table is empty.  When exchanging partitioned index-organized tables: – The source and target table or partition must have their primary key set on the same columns, in the same order. – If key compression is enabled, then it must be enabled for both the source and the target, and with the same prefix length. – Both the source and target must be index organized. – Both the source and target must have overflow segments, or neither can have overflow segments. Also, both the source and target must have mapping tables, or neither can have a mapping table. – Both the source and target must have identical storage attributes for any LOB columns. 

    Read the article

  • Output a php multi-dimensional array to a html table

    - by Fireflight
    I have been banging my head against the wall with this one for nearly a week now, and am no closer than I was the first day. I have a form that has 8 columns and a variable number of rows which I need to email to the client in a nicely formatted email. The form submits the needed fields as a multidimensional array. Rough example is below: <input name="order[0][topdiameter]" type="text" id="topdiameter0" value="1" size="5" /> <input name="order[0][bottomdiameter]" type="text" id="bottomdiameter0" value="1" size="5" /> <input name="order[0][slantheight]" type="text" id="slantheight0" value="1" size="5" /> <select name="order[0][fittertype]" id="fittertype0"> <option value="harp">Harp</option> <option value="euro">Euro</option> <option value="bulbclip">Regular</option> </select> <input name="order[0][washerdrop]" type="text" id="washerdrop0" value="1" size="5" /> <select name="order[0][fabrictype]" id="fabrictype"> <option value="linen">Linen</option> <option value="pleated">Pleated</option> </select> <select name="order[0][colours]" id="colours0"> <option value="beige">Beige</option> <option value="white">White</option> <option value="eggshell">Eggshell</option> <option value="parchment">Parchment</option> </select> <input name="order[0][quantity]" type="text" id="quantity0" value="1" size="5" /> This form is formatted in a table, and rows can be added to it dynamically. What I've been unable to do is get a properly formatted table out of the array. This is what I'm using now (grabbed from the net). <?php if (isset($_POST["submit"])) { $arr= $_POST['order'] echo '<table>'; foreach($arr as $arrs) { echo '<tr>'; foreach($arrs as $item) { echo "<td>$item</td>"; } echo '</tr>'; } echo '</table>; }; ?> This works perfectly for a single row of data. If I try submitting 2 or more rows from the form then one of the columns disappears. I'd like the table to be formatted as: | top | Bottom | Slant | Fitter | Washer | Fabric | Colours | Quantity | ------------------------------------------------------------------------ |value| value | value | value | value | value | value | value | with additional rows as needed. But, I can't find any examples that will generate that type of table! It seems like this should be something fairly straightforward, but I just can't locate an example that works the way I need it too.

    Read the article

  • jQuery table replace

    - by Happy
    We have a table: <table> <tr> <td width="10">1</td> <td>text 1</td> </tr> <tr> <td width="10">2</td> <td>text 2</td> </tr> <tr> <td width="10">3</td> <td>text 3</td> </tr> <tr> <td width="10">4</td> <td>text 4</td> </tr> <tr> <td width="10">5</td> <td>text 5</td> </tr> <tr> <td width="10">6</td> <td>text 6</td> </tr> <tr> <td width="10">7</td> <td>text 7</td> </tr> <tr> <td width="10">8</td> <td>text 8</td> </tr> <tr> <td width="10">9</td> <td>text 9</td> </tr> <tr> <td width="10">10</td> <td>text 10</td> </tr> </table> We update this table by throwing into each <tr> 3 <td>, each <td> with width="10" attribute must be deleted. It must look like: <table> <tr> <td>text 1</td> <td>text 2</td> <td>text 3</td> </tr> <tr> <td>text 4</td> <td>text 5</td> <td>text 6</td> </tr> <tr> <td>text 7</td> <td>text 8</td> <td>text 9</td> </tr> <tr> <td>text 10</td> </tr> </table> How can we do this? Thanks.

    Read the article

  • 100% width table cell

    - by Elvis
    Hello! I have this table layout. I want to align the whole content to the right. So i'm using one cell with width: 100%;. Usually everything looks good and nice. But there is something, which i don't understand. If the content in cell, which has colspan, becomes bigger than normal cell in this column (you can test this by clicking Click to test button), it brakes whole layout. This happens on Chrome, Safari 4 and 5, IE8, but on Opera, FF and IE7 is OK. Any ideas? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>TEST</title> <style type="text/css"> table { width: 100%; } table td { border: 1px solid black; white-space: nowrap; } .delimiter { width: 100%; } </style> </head> <body> <table> <tr> <td><label>Row 1</label></td> <td>&nbsp;</td> <td><input type="text" value="Field 1" id="field1" size="25"></td> <td><input type="button" value="Click to test" onclick="var o = document.getElementById('field2'); o.size = o.size == 25 ? 50 : 25;"></td> <td class="delimiter">&nbsp;</td> </tr> <tr> <td><label>Row 2</label></td> <td>&nbsp;</td> <td colspan="3"><input type="text" id="field2" value="Field 2" size="25"></td> </tr> </table> </body> </html>

    Read the article

  • Parse and transform XML with missing elements into table structure

    - by dnlbrky
    I'm trying to parse an XML file. A simplified version of it looks like this: x <- '<grandparent><parent><child1>ABC123</child1><child2>1381956044</child2></parent><parent><child2>1397527137</child2></parent><parent><child3>4675</child3></parent><parent><child1>DEF456</child1><child3>3735</child3></parent><parent><child1/><child3>3735</child3></parent></grandparent>' library(XML) xmlRoot(xmlTreeParse(x)) ## <grandparent> ## <parent> ## <child1>ABC123</child1> ## <child2>1381956044</child2> ## </parent> ## <parent> ## <child2>1397527137</child2> ## </parent> ## <parent> ## <child3>4675</child3> ## </parent> ## <parent> ## <child1>DEF456</child1> ## <child3>3735</child3> ## </parent> ## <parent> ## <child1/> ## <child3>3735</child3> ## </parent> ## </grandparent> I'd like to transform the XML into a data.frame / data.table that looks like this: parent <- data.frame(child1=c("ABC123",NA,NA,"DEF456",NA), child2=c(1381956044, 1397527137, rep(NA, 3)), child3=c(rep(NA, 2), 4675, 3735, 3735)) parent ## child1 child2 child3 ## 1 ABC123 1381956044 NA ## 2 <NA> 1397527137 NA ## 3 <NA> NA 4675 ## 4 DEF456 NA 3735 ## 5 <NA> NA 3735 If each parent node always contained all of the possible elements ("child1", "child2", "child3", etc.), I could use xmlToList and unlist to flatten it, and then dcast to put it into a table. But the XML often has missing child elements. Here is an attempt with incorrect output: library(data.table) ## Flatten: dt <- as.data.table(unlist(xmlToList(x)), keep.rownames=T) setnames(dt, c("column", "value")) ## Add row numbers, but they're incorrect due to missing XML elements: dt[, row:=.SD[,.I], by=column][] column value row 1: parent.child1 ABC123 1 2: parent.child2 1381956044 1 3: parent.child2 1397527137 2 4: parent.child3 4675 1 5: parent.child1 DEF456 2 6: parent.child3 3735 2 7: parent.child3 3735 3 ## Reshape from long to wide, but some value are in the wrong row: dcast.data.table(dt, row~column, value.var="value", fill=NA) ## row parent.child1 parent.child2 parent.child3 ## 1: 1 ABC123 1381956044 4675 ## 2: 2 DEF456 1397527137 3735 ## 3: 3 NA NA 3735 I won't know ahead of time the names of the child elements, or the count of unique element names for children of the grandparent, so the answer should be flexible.

    Read the article

  • Correct table layout generation with CSS: unexpected cells shift

    - by MrG
    I'm trying to generate a dynamic table using CSS: <html> <head> <style> div.el1, div.el2 { color:white; width:70px;height:70px; border:0px; padding:0px; font-size: 10px; font-family: "Courier"; } div.el1 { background-color: green; } div.el2 { background-color: orange; } div.tablediv { display: table; border:0px; border-spacing:0px; border-collapse:separate; } div.celldiv { display: table-cell; } div.rowdiv { display: table-row; width:auto; } </style> </head> <body> <div class="tablediv"> <div class="rowdiv"> <div class="celldiv"> <div class="el1" id="x1y1">ABC</div> </div> <div class="celldiv"> <div class="el2" id="x1y2"></div> </div> </div> <div class="rowdiv"> <div class="celldiv"> <div class="el1" id="x2y1"></div> </div> <div class="celldiv"> <div class="el1" id="x2y2"></div> </div> </div> </div> </body> </html> The content of body is dynamically generated and should be displayed as a table. Unfortunately, each cell shifts down if it contains data: expected reality --- --- --- --- | | | | | | --- --- |ABC|--- | | | | | | --- --- --- --- | | | --- --- I'm grateful for any help. Many thanks!

    Read the article

  • How can I "merge", "flatten" or "pivot" results from a query which returns multiple rows into a sing

    - by dsm
    I have a simple query over a table, which returns results like the following: id id_type id_ref 2702 5 31 2702 16 14 2702 17 3 2702 40 1 2702 26 4 And I would like to merge the results into a single row, for instance: id concatenation 2702 5,16,17,40,26:31,14,3,1,4 Is there any way to do this within a trigger? NB: I know I can use a cursor, but I would really prefer not to unless there is no better way.

    Read the article

  • SQL SERVER – Size of Index Table for Each Index – Solution 3 – Powershell

    - by pinaldave
    Laerte Junior If you are a Powershell user, the name of the Laerte Junior is not a new name. He is the one man with exceptional knowledge of Powershell. He is not only very knowledgeable, but also very kind and eager to those in need. I have been attempting to setup Powershell for many days, but constantly facing issues. I was not able to get going with this tool. Finally, yesterday I sent email to Laerte in response to his comment posted here. Within 5 minutes, Laerte came online and helped me with the solution. He spend nearly 15 minutes working along with me to solve my problem with installation. And yes, he did resolve it remotely without looking at my screen – What a skilled and exceptional person!! I will soon post a detail note about the issue I faced and resolved with the help of Laerte. Here is his solution to my earlier puzzle in his own words. Read the original puzzle here and Laerte’s solution from here. Hi Pinal, I do not say better, but maybe another approach to enthusiasts in powershell and SQLSPX library would be: 1 – All indexes in all tables and all databases Get-SqlDatabase -sqlserver “Yourserver” | Get-SqlTable | Get-SqlIndex | Format-table Server,dbname,schema,table,name,id,spaceused 2 – All Indexes in all tables and specific database Get-SqlDatabase -sqlserver “Yourserver” “Yourdb” | Get-SqlTable | Get-SqlIndex | Format-table Server,dbname,schema,table,name,id,spaceused 3 – All Indexes in specific table and database Get-SqlDatabase -sqlserver “Yourserver” “Yourdb” | Get-SqlTable “YourTable” | Get-SqlIndex | Format-table Server,dbname,schema,table,name,id,spaceused and to output to txt.. pipe Out-File Get-SqlDatabase -sqlserver “Yourserver” | Get-SqlTable | Get-SqlIndex | Format-table Server,dbname,schema,table,name,id,spaceused | out-file c:\IndexesSize.txt If you have one txt with all your servers, can be for all of them also. Lets say you have all your servers in servers.txt: something like NameServer1 NameServer2 NameServer3 NameServer4 We could Use : foreach ($Server in Get-content c:\temp\servers.txt) { Get-SqlDatabase -sqlserver $Server | Get-SqlTable | Get-SqlIndex | Format-table Server,dbname,schema,table,name,id,spaceused } :) After fixing my issue with Powershell, I ran Laerte‘s second suggestion – “All Indexes in all tables and specific database” and found the following accurate output. Click to Enlarge Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Index, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Powershell

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >