I have like this now.
<tr ng-repeat="a in xx">
<td>Name</td>
<td>{{a.name}}</td>
</tr>
<tr ng-repeat ="b in kk">
<td>Id</td>
<td>{{b.ll}}</td>
</tr>
But i need the two loops inside one tr.Means, I need 4 td inside one tr.
How can I do it.
You would need to reply on the $index to reference the second array:
<tr ng-repeat="a in xx">
<td>Name</td>
<td>{{a.name}}</td>
<td>Id</td>
<td>{{kk[$index].ll}}</td>
</tr>
Related
I have a bootstrap datatable-basic with a few pages.
In the first cell of the table is a checkbox.
The table looks like that just with a few more rows.
<table class="table datatable-basic table-hover" >
<thead>
<tr>
<th>Status</th>
<th>Keyword</th>
<th>Suchvolumen</th>
</tr>
</thead>
<tbody>
<tr>
<td> <input type="checkbox" id="checkboxManuellerStatus1" name="checkboxManuellerStatus[1]" value="abc"> abc</td>
<td class="keywordDataStyle">abc</td>
<td>abc</td>
</tr>
<tr>
<td> <input type="checkbox" id="checkboxManuellerStatus2" name="checkboxManuellerStatus[2]" value="abc2"> abc</td>
<td class="keywordDataStyle">abc</td>
<td>abc</td>
</tr>
</tbody>
All checkboxes have incrementing names and ids. checkboxManuellerStatus1,checkboxManuellerStatus2,checkboxManuellerStatus3,... and so on.
If I request the checkboxes in php, I get all the values of checked checkboxes.
$array = $_REQUEST['checkboxManuellerStatus'];
Thats good, except that I only get the values of the current page in the table, but I need all values of all pages. How do I do that?
Thanks
Is there a way to display two HTML tables side by side in a PDF-document generated with TCPDF?
I tried inline-CSS but neither float: left nor display: inline-block works.
I am using version 6.2.12.
You should try merging two table inside another parent table like:
<table>
<tr>
<td>
<table>
<tr>
<td>data that you want to display left</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>data that you want to display right</td>
</tr>
</table>
</td>
</tr>
</table>
add this html to variable and then pass that variable into tcpdf menthod writeHTML().
I have a HTML thus like:
<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Age</th>
</tr>
<tr>
<td>Joe Bloggs</td>
<td>joe#bloggs.com</td>
<td>40</td>
</tr>
<tr>
<td>John Doe</td>
<td>john#doe.com</td>
<td>40</td>
</tr>
</table>
Is there a way using xPath to get the first 2 columns, i.e the Name and Email fields?
I can get the table data using $data = $xpath->query( '//table'); just unsure how to get only the first 2 columns.
Many thanks
Get the first two td's:
//table/tr/td[position() <= 2]
i have some problems with my table i have this table for egs
<tr style="">
<td>1</td>
<td>item 1</td>
</tr>
<tr style="">
<td>1.1</td>
<td>item 1.1</td>
</tr>
<tr style="">
<td>1.2</td>
<td>item 1.2</td>
</tr>
<tr style="">
<td>1.1.1</td>
<td>item 1.1.1</td>
</tr>
i use jquery ui sortable but the problem is that if i want to move the item 1 the item1.2 and item 1.1.1 will also follow something like a group
fiddle link http://jsfiddle.net/kN2XL/
You should have a look at nestedSortable to implement this kind of functionality. Example
Unfortuately, you will however need to change your html from tables into a hierarchy, like <ul> <li> etc.
How can I get the class of the table when clicking the tr?
This is my code
<table class='table1' border='1'>
<tr class='graph1'>
<td>Test1</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
<tr class='graph2'>
<td>Test2</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
<tr class='graph3'>
<td>Test3</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
</table>
<table class='table2' border='1'>
<tr class='graph1-1'>
<td>Test1</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
<tr class='graph2-1'>
<td>Test2</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
<tr class='graph3-1'>
<td>Test3</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
</table>
When I click on
<tr class='graph2'>
<td>Test2</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
It should display 'table1'
or if I click on
<tr class='graph3-1'>
<td>Test3</td>
<td><a class='viewHistory'>View History<a></td>
</tr>
It should display: 'table2'
Take not that this is dynamic, its not only graph2 or graph3-1 will be clicked.
how would I do that using jquery?
Any help would be greatly appreciated and rewarded! Thanks!
I would use closest() to find the table parent. See also http://api.jquery.com/closest/
$('.viewHistory').click(function() {
var classname = $(this). closest('table').attr('class');
alert(classname);
}
jQuery('table tr').click(function(){
//this is set to the row's DOM element
jQuery(this).parent('table').attr('class');
});
See the jQuery.parent for details.
Never used it personally so not sure about this, but jQuery.closest may give better performance compared to jQuery.parent.
Also, please note that the following code sample will attach click event for any table row in the document, so you'd better add some specific class to your tables (say clickable_table and use it like this)
jQuery('.clickable_table tr').click(function(){
//this is set to the row's DOM element
jQuery(this).parent('table').attr('class');
});
You can use the .parent() function (if you want to click the a tag, use it twice)
and the .attr("class") to get the class. I think there is also a .class or something but not sure right now.