w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
html nested table hide or show table row by clicking table row first td
use td:first in your selector to select the first td and parent().next() to toggle the next tr try this $(".toptable tr.accordion td:first").click(function(){ //--^^^^^^^^---here $(this).parent().next().fadeToggle(); //----^^^^^^^^^---here }); updated after the comment below it is not not working for second row.means if iam clicking on second row first td it has to show some other table row. try this $(".toptable tr").find('td:first').click(function(){ $(this).parent().next().fadeToggle(); }); working fiddle

Categories : Javascript

html nested table hide or show table last td by clicking table row first td
Try below code $(function () { $(".toptable > tbody > tr > td:not(.n1)").hide(); $(".toptable tr").find("td:first").click(function () { $(this).closest('tr').children('td:last').show(); }); }); Also check sample on jsfiddle http://jsfiddle.net/7Jfx7/1/

Categories : Javascript

Create this table using a single classic html table element and rowspan/colspan
Here is the code for you. I hope this becomes useful to you because I spent an hour trying to create this for you. (notice HTML 5 recommends using CSS but since you wanted this in just classic html here is the solution for you) <table width="800" height="400"> <tr width=50%> <td width="33%" bgcolor="#6CBB3C"></td> <td width="33%" rowspan="2" bgcolor="#C24641" width=40%></td> <td width="33%" bgcolor="#6CBB3C"></td> </tr> <tr width=50%> <td width="33%" bgcolor="#6CBB3C"></td> <td width="33%" bgcolor="#6CBB3C"></td> </tr> </table> <table width="800" height="400"> <tr width="50

Categories : HTML

Having Issues creating a loop for HTML table in code and assigning cells for table
Something on the following lines: Dim strTable as New StringBuilder() strTable.Append("<table Style='border:2;border-width: 1px;'>") For Each dr As DataRowView In dv Dim crossover As String = dr("CrossoverID").ToString() Dim picid As String = dr("Description").ToString() Dim picdescrip As String = dr("DesignColor").ToString() strTable.Append("<tr>") For j As Integer = 0 To 4 strTable.Append(String.Format("<td>{0}</td>"), crossover)) Next strTable.Append("</tr>") Next strTable.Append("</table>") divTable.InnerHtml = strTable Note the following: Since you can have a large number of rows, prefer StringBuilder over string. I don't really think you need an inner loop to construct your TDs. You'll probably have 6

Categories : SQL

Display mysql data in HTML Table - Latest entry to be shown @ top of table
It depends how much data you are planning to show. I'll start with the most general technique, and probably the simplest - make sure your data includes a time added. Then your query is select * from table_name order by time_added desc Adapt it - table name, column names, what to select... Desc is for descending or you can use asc. To display, loop as usual, to only display the first few results, limit the query as usual. If for some reason you can't do that, the alternative is to set up the display in the reverse order. It isn't the best - but knowing you don't have to display the results as they come out is always good. To do this, you don't change your query, the data comes out in reverse order, and you then loop through it but prepare the display backwards: $result = mysqli_quer

Categories : PHP

Show values from a mySQL database table inside a html table in a page
Example taken from w3schools: http://www.w3schools.com/php/php_mysql_select.asp <?php $con=mysqli_connect("example.com","peter","abc123","my_db"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM Persons"); echo "<table border='1'> <tr> <th>Firstname</th> <th>Lastname</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?> It's a good place to learn from

Categories : PHP

Html table with fixed header and vertical scrollbars on the table body
Isn't this what you're looking for? - http://www.imaputz.com/cssStuff/bigFourVersion.html Just view the source of the example, and this should get you going.

Categories : HTML

jquery table replace partial table content inside html
You are using the wrong selector. There should be no space between `"td :contains"` ^------- Remove this space Supposed to be $("td:contains('name:')").text("Hello:"); You can also try $("td b:contains('name:')").text("Hello:"); Check Fiddle

Categories : Jquery

can't remove css defined table style for specific table in html
you can check out how the css rules define in your page if the rule defined like: '.targetTable'{} (by class) or '#tableId'{} (by id) it would be easy to remove the css rule by changing the table class/id on html code else if it defined like: 'table{}' (by object) Method 1:use jquery to reset the table(which you want to use other style) css Method 2:change the css rule by using class or id selector

Categories : HTML

Update a MySQL table from an HTML table with thousands of rows
My Suggestion is instead of updating values row by row try to use Bulk Insert in temporary table and then move the data into an actual table based on some timing key. If you have key column that will be good for reading the recent rows as you added.

Categories : Python

CodeIgniter: Populating a table (HTML/ form) from database (table)
That is because you forgot to return data in your model. try this Model function roomsTable() { $query = $this->db->select(array('room_number','rt_name'))->get('rooms'); return $query; //<---here }

Categories : PHP

I have two table called Event table and Date table.I want to show following display table without duplicating rows using sql
Try this: For MySQL SELECT EVENT_NAME, REPLACE(REPLACE(DATE_FORMAT(START_DATE, '%Y/%m/%d %h:%i:%s %p'), 'AM', 'a.m.'), 'PM', 'p.m.') START_DATE, CONCAT(REPLACE(REPLACE(DATE_FORMAT(START_DATE, '%Y/%m/%d %h:%i:%s %p'), 'AM', 'a.m.'), 'PM', 'p.m.'), ' - ', REPLACE(REPLACE(DATE_FORMAT(END_DATE, '%Y/%m/%d %h:%i:%s %p'), 'AM', 'a.m.'), 'PM', 'p.m.')) FROM_TO FROM (SELECT ET.EVENT_NAME, MIN(STR_TO_DATE(REPLACE(ET.START_DATE, '.', ''), '%Y/%m/%d %h:%i:%s %p')) START_DATE, MAX(STR_TO_DATE(REPLACE(ET.START_DATE, '.', ''), '%Y/%m/%d %h:%i:%s %p')) END_DATE FROM EVENT_TABLE ET INNER JOIN DATE_TABLE DT ON ET.E_ID = DT.E_ID GROUP BY ET.E_ID ) AS A;

Categories : Mysql

HTML CSS Table displays rows at bottom instead of the top of the table
The header row is filling out the space vertically (this is what it should do because of your table-layout. If you wrap it with <thead> and then only wrap the body of the table with <tbody> it will align it correctly. However, because you have table-layout: fixed, with height: 250px, the remaining rows will grow to make up the difference. See: http://codepen.io/chrisrockwell/pen/gGmFq Can you add a class to the table if it doesn't have a full set of rows? This way you could remove the height declaration. Other options: I'm guessing you need to have a set height but, if not, you could remove it. Wrap the table in a <div> and assign your height and overflow to the div: <div class="wrap"> <table class="feeds"></table> </div> .wrap { he

Categories : HTML

Return table row as a HTML code via ajax and add in table
Change the following line in the JS function success:function(data){ //$("#bill_tbl")..after(data); $(".table").append(data); } Remove the div#bill_tbl from the table

Categories : PHP

how to fetch particular record from table X joining table Y or table Z where table Y and Z has same column name with same kind of data?
Assuming that the child record will ALWAYS be in either equipment or equipment2, but never both, you could just add equipment2 with an outer join, and use NVL() to pick the not null value: SELECT TO_CHAR (a.LOG_DATE, 'mm/dd/yyyy HH:MI:SS') LOG_DATE, nvl(b.id,b2.id), a.atid, a.l_type, a.l_subtype, a.eq, a.name, a.comments FROM log a, equipment b, equipment2 b2 WHERE a.eqid = b.eqid(+) AND a.eqid = b2.eqid(+) AND log_date BETWEEN TO_DATE ('07/01/2013', 'MM/DD/YYYY') AND TO_DATE ('07/08/2070', 'MM/DD/YYYY') ORDER BY 2 This also assumes that you're only picking a column that will not be populated with a NULL. If, for example, equipment/equipment2 also contains a "name" column that might be null, you'd need some additional logic: case when b.

Categories : SQL

Join two table show all record on left table if right table exists, use right table
you can use Full outer join here... here is an example SELECT Customers.CustomerName, Orders.OrderID FROM Customers FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID

Categories : SQL

HTML::TableExtract with a table inside of a table
I didn't see any document about chain method in the doc of HTML::TableExtract. Maybe you're using an expired version? But according to the doc, you could do this using the depth and count attributes: $te = HTML::TableExtract->new( headers => [qw(Unit DIS ENR ONS LEF ARR BUS REM COM)], depth => 1, count => 1 ); $te->parse($html_string); depth: Specify how embedded in other tables your tables of interest should be. Top-level tables in the HTML document have a depth of 0, tables within top-level tables have a depth of 1, and so on. count: Specify which table within each depth you are interested in, beginning with 0. In your case depth an

Categories : Perl

Convert WPF FlowDocument Table to HTML table
This should work for you: <FlowDocument> <Table Width="Auto" Height="Auto"> <Table.Columns> <TableColumn /> <TableColumn /> <TableColumn /> </Table.Columns> <TableRowGroup> <TableRow> <TableCell> <Paragraph>Cell at Row 1 Column 1</Paragraph> </TableCell> <TableCell> <Paragraph>Cell at Row 1 Column 2</Paragraph> </TableCell> <TableCell> <Paragraph>Cell at Row 1 Column 3</Paragraph> </TableCell> </TableRow> </TableRowGroup> </Table> </FlowDocument>

Categories : Wpf

php table Pagination how to put $output into my html table?
First of all try to put the braces for the while statement, then please give some details of how the result of the query looks like :) Or why you can't put that "echo". If you want to add that "Des" in front, then you will do something like this: echo "Des: ". $output["description"]. "<br />";

Categories : PHP

Proper way to put the database table id on HTML Table
You can do this using Hidden field or using get method , but i don't see your form nor your buttons, this code will add a hidden field containing value of id: <?php echo '<tr>'; echo '<td><b>'.$id.'</b></td>';// HERE echo '<td><b>'.$client.'</b>'; echo "<input type='hidden' name='id' value='$id'/></td>";//this line ?>

Categories : PHP

HTML: How to increase width of table columns when the table is inside a div with fixed width
Why not use percentages? jsfiddle: http://jsfiddle.net/qCYDq/ also you are limiting yourself with 200px in width, if the text inside the table (word width) is larger than your 200px it will force its width and then cause your scroller to appear as the table will stretch to fit the words. <!DOCTYPE html> <html> <head> <style> table { border-collapse:collapse; width: 100%; font-size: 9px; } td,th { border:1px solid black; width: 25%; } .myclass { width:200px; overflow:auto } </style> </head> <body> <div class="myclass"> <table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Savings</th> <th>Expenditure

Categories : HTML

select all of table A left join column of table B with multiple wheres that dont affect showing all of table A
I think you just need to move the condition on the work_orders_billing_codes table into the on clause. Then if there is no match, you will still get all the appropraite records in billing_codes. SELECT bc.`id` AS `id`, bc.`billing_code` AS `billing_code`, bc.`desc` AS `desc`, bc.`point_value` AS `point_value`, wobc.`quantity` AS `quantity`, wobc.`billing_code_id` AS `id2` FROM `cl_billing_codes` bc LEFT JOIN `cl_work_orders_billing_codes` wobc ON bc.id = wobc.`billing_code_id` AND wobc.`work_order_id` = 1585 WHERE bc.`service` = '1' ORDER BY `billing_code`;

Categories : PHP

History table referencing other values in the table / accessing package table variables
After some reflection I've got to go with @tbone on this one. In my experience a history table should be a copy of the data in the "real" table with fields added to show when particular 'version' of the data shown by a row in the history table was in effect. So if the "real" table is something like CREATE TABLE REAL_TABLE (ID_REAL_TABLE NUMBER PRIMARY KEY, COL2 NUMBER, COL3 VARCHAR2(50)); then I'd create the history table as CREATE TABLE HIST_TABLE (ID_HIST_TABLE NUMBER PRIMARY KEY ID_REAL_TABLE NUMBER, COL2 NUMBER, COL3 VARCHAR2(50), EFFECTIVE_START_DT TIMESTAMP(9) NOT NULL, EFFECTIVE_END_DT TIMESTAMP(9)); and I'd have the following triggers to get everything populated: CREATE TRIGGER

Categories : SQL

Select data from one table and insert into another existing table, which doesn't exist in the table
I think you are looking for this INSERT INTO table4( id1, id3) SELECT id1, id3 FROM table2 INNER JOIN table1 ON table1.id2 = table2.id2 Left JOIN table3 ON table2.name2 = table3.name3 WHERE name2 LIKE 'input' and table3.name3 is null or something similar. Left (outer join) gets all the records in table2 whether they exist or not. If they don't table3.name3 will be null, so those are the chaps you want.

Categories : Mysql

Getting links from an HTML table using HTML::TableExtract and HTML::Extor in Perl
You don't describe what the problem is...what exactly doesn't work? What does $row->[0] contain? But part of the problem might be that TableExtract returns just the 'visible' text, not the raw html, by default. You probably want to use the keep_html option in HTML::TableExtract.

Categories : HTML

Create table which hold columns of another table and count values of another table
Don't create a new table. Just create a view: create view new_temp select 'pcount' as ind_type, sum(pcount) as thecount from temp union all select 'ncount', sum(ncount) from temp; Only create a new table if you really need to for performance reasons. If you do create a new table, then you have to also write triggers for the temp table when values change (insert, update, delete). A view is much simpler. EDIT: Oh, I misunderstood the format for the table you want. You want one row with two columns. That is even easier: create view new_temp select sum(pcount) as pcount, sum(ncount) as ncount from temp;

Categories : Mysql

SQL Insert from table to table prevented by duplicate primary key from source table
You'll need to declare the columns except the ID on both the INSERT and the SELECT, since the number of fields need to match, and id (as you noticed) can't be inserted as is into the destination table. INSERT INTO DestTable (field1, field2, field3) SELECT field1, field2, field3 FROM SourceTable; An SQLfiddle to test with. EDIT: You could do it in a bit more hacky way to simplify the insert. You can create a trigger that simply forces the primary key to NULL on insert. CREATE TRIGGER t_DT BEFORE INSERT ON DestTable FOR EACH ROW SET NEW.id = NULL; then a copy from table to table can be done as simply; INSERT INTO DestTable SELECT * FROM SourceTable; Another SQLfiddle.

Categories : Mysql

Select data from table B where a field in table B matches table A (php mySQL)
Assuming table_a is the name of the livestock table and table_b is the table with the description in it, you'll want to join the tables on the 'scientific' field. SELECT table_a.*, table_b.Description FROM table_a JOIN table_b ON table_a.Scientific = table_b.Scientific You'll want to replace table_a and table_b with the correct table names.

Categories : PHP

select from table with function using pipelined table functions and associative table
First, the Table type should be out of the package: create type con_coll_t is table of con_coll_type; And, if you have default values for your types, you can implement them like that: coll_delete con_coll_t; begin coll_delete := con_coll_t(con_coll_type(3, 'some_name_3'), con_coll_type(4, 'some_name_4')); end; With that being said, I think your general code should be something like that: -- the creation of an array type create or replace type con_coll_type is object( id integer, user_name varchar2(255)); create or replace type con_coll_t is table of con_coll_type; create or replace package task_2 is function get_con_coll(coll_name varchar2) return con_coll_t pipelined; end task_2; create or replace p

Categories : Oracle

How to ignore inserting records from a table to another table when both table field has same value in MySQL?
MySQL support UPDATE ON DUPLICATE KEY but in order to work, you need to add a unique constraint on the table you want to insert. Assuming Table3 is the name of your new table. You need to add constraint first, ALTER TABLE Table3 ADD CONSTRAINT tb_uq UNIQUE (name, email) and you can now have unique records on the new table, to merge the previous table, INSERT INTO table3(name, email) SELECT name, email FROM ( SELECT fid id, fname name, email FROM Table1 UNION ALL SELECT gid id, gname name, gemail email FROM Table1 ) s ON DUPLICATE KEY UPDATE name = VALUES(name); SQLFiddle Demo INSERT ... ON DUPLICATE KEY UPDATE Syntax An alternative solution without using ON DUPLICATE KEY UPDATE. is to use UNION (without ALL) and assumes that Table3.ID is set as auto-increment INSE

Categories : Mysql

Select from a table and insert to another table and deleting it from the source table
Have a look at: MySQL Trigger - delete after update What you want is to trigger a delete after your insert. DELIMITER $$ CREATE TRIGGER trigger1 AFTER INSERT ON tbl_friends FOR EACH ROW BEGIN DELETE FROM tbl_requests WHERE ID = new.id; END $$

Categories : Mysql

Add rows to a table from another table using Common table expression in SQL Server
insert TableB (ID, Name, Code) select row_number() over (order by Name, Code) , Name , Code from ( select Name , A as Code from TableA union all select Name , B from TableA union all select Name , C from TableA union all select Name , D from TableA ) SubQueryAlias

Categories : SQL

How to add rows to second table from the first table using Common table expression in SQL Server
You can do it with two inserts: insert into tableB(A, B) select A1, B1 from tableA; insert into tableB(A, B) select A2, B2 from tableA; Or union the table with one insert: insert into tableB(A, B) select A1, B1 from tableA union all select A2, B2 from tableA; This assumes that id is defined as id int indentity(1, 1) so it automatically increments. If not, you could assign it as: insert into tableB(id, A, B) select row_number() over (order by (select NULL)) as id, A1, B1 from (select A1, B1 from tableA union all select A2, B2 from tableA ) t

Categories : SQL

Trying to use HTML::TableExtract in Perl to extract table from HTML file, but failing
This seems to work with the URL you provided: use 5.014; use strict; use warnings; use open qw(:std :utf8); use HTML::TableExtract; my $te = HTML::TableExtract->new( headers => [qw(Ligand Sp. Action Affinity Units Reference)], ); $te->parse_file('sample.html'); my @tables = $te->tables; for my $t (@tables) { my @rows = $t->rows; for my $r (@rows) { for my $c (@$r) { $c =~ s/As+//; $c =~ s/s+z//; } say "@$r"; } }

Categories : Perl

How to sent dynamic html table data from html form to php file
One way would be, you can loop all the tables and get the values of the first four table cells(TD) for each row in the table, assuming all the tables have same columns, and generate a json javascript object and send that object to your server via javascript. sample: var data = { 'department1': { 'eventname': 'xyz', 'emailid': 'x@xyz.com', 'registrationfee' : '300', 'studentname': 'me', 'contactno': '999999999' }, 'department2': { 'eventname': 'xyz2', 'emailid': 'y@xyz.com', 'registrationfee' : '500', 'studentname': 'me2', 'contactno': '9999988888' }, ..... }; and send the data via post ajax call using jquery or plain javascript. You can access the data on the server side. If you are using a php framework it might automatically decode the json a

Categories : PHP

Create table table if not exists else alter table
There is an ungly hack for this, that works quite well create a script, that does the CREATE TABLE IF NOT EXISTS ... stuff does the ALTER TABLE ... stuff ignoring a resulting error commits suicide by doing file_put_contents(__FILE__,''); include it. On first run, it will do what has to be done, on later runs you will include an empty file. Even concurrent first runs will be no problem, as the IF NOT EXISTS consition is true only once, and the ALTER TABLE will just fail. This provides an ugly-but-working path from either no table or the wrong version of the table to the desired version.

Categories : PHP

Column does not belong to table Table/Cannot find table 0
It might occured when you assign New DataSet to your dataset variable If you only use 1 table in dataset, it's would be easier if you use datatable without dataset .. Public tbl as New DataTable oSqlDataAdapter.Fill(tbl) This won't make you got that error ...

Categories : Asp Net

how to fetch all row from one table and select row from other table based on first table?
We would need to know more about the tables, but just by looking at the column names it seems you are using the wrong Uid's. If you have a one-to-many (since you are saying "images from sender") relation from Message to Image, and each table has their own Uid, then on the Image table you should have a foreign key pointing to the Uid from Message, and the query would look something like this: SELECT msg.Uid, msg.Fid, msg.Message, img.ImagePath, img.Uid FROM Message msg LEFT JOIN Image img ON msg.Uid = img.MessageUid

Categories : SQL

Retriving data from table, where their are 3 table A,B,C . And refrence of Table C is in B, Table's B refrence is in A
How about something like SELECT c.* FROM TableC c INNER JOIN TableB b ON b.CID = c.ID INNER JOIN TableA a ON a.BID = b.ID WHERE a.ID = 123 AND b.ID = 212

Categories : Mysql

Two HTML table under each other
If you add a class to the tables you should be able to remove the margins and padding table { margin: 0; padding: 0; } If you need them to line up precisely then specify the width of each field td { width: 10%; }

Categories : HTML



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.