collapsable content not indenting - html

I am loading some table content with collapse-panel, its in tabular format - like there are three rows and three columns , if i click on first column of first row which is header of that row , it expands and show its details, which again in tabular format,
image attached - before expanding
second image is when i click on orders , it expands and show its details.
the problem is .. when it expands , it shows its detailed table data only in its own column , as in image you can see "fsdfdsfds" column is excluded, i am trying to do that when it expands and show the details , it should show in a full row just below the entire row of main header ..
please see the code , any help ??
<table class="table">
<tr>
<td>
<a class="btn btn-default hide_retail" data-toggle="collapse" href="#show_retail" id="hide_retail">Orders</a>
<div id="show_retail" class="panel-collapse collapse">
<div class="panel-body">
dsfsdfd
<table class="table">
<tr>
<td>sdfdsf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
<td>sdfdsf</td>
<td>sdfdsf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
</tr>
<tr>
<td>sdfdsf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
<td>sdfdsf</td>
<td>sdfdsf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
</tr>
<tr>
<td>sdfdsf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
<td>sdfdsf</td>
<td>sdfdsf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
<td>sfsdf</td>
<td>dsfsdf</td>
</tr>
</table>
</div>
</div>
</td>
<td>fsdfdsfds</td>
<tr>
<td>fdsdf</td>
<td>fddsfd</td>
UPDATE : SOLVED -- i got the solution -- here-- > https://www.bootply.com/glebkema/Qyh5hbEMdU

You have to change structure of your HTML, here is the table what you asked,
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js"></script>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Column</th>
<th>Column</th>
</tr>
</thead>
<tr data-toggle="collapse" data-target="#r1">
<td>Data</td>
<td>Data</td>
</tr>
<tr id="r1" class="collapse out">
<td>
Table inside the td
<table class="table">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
</td>
<td>- Child column 2</td>
</tr>
<tr data-toggle="collapse" data-target="#r2">
<td>Data</td>
<td>Data</td>
</tr>
<tr id="r2" class="collapse out">
<td> - Child column 1</td>
<td>- Child column 2</td>
</tr>
</table>

Related

angular 6: How to make expandable table with ngfor?

I have a table in angular 6. This is working find, But I want to use it in ngfor and it not working as expected. Here is the table:
.hiddenRow {
padding: 0 !important;
}
<table class="table table-condensed" style="border-collapse:collapse;">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Description</th>
<th>Credit</th>
</tr>
</thead>
<tbody>
<tr data-toggle="collapse" data-target="#demo1" class="accordion-toggle" style="cursor: pointer;">
<td>1</td>
<td>05 May 2013</td>
<td>Credit Account</td>
<td class="text-success">$150.00</td>
</tr>
<tr>
<td colspan="12" class="hiddenRow">
<div class="accordian-body collapse jumbotron" id="demo1">
Demo1
</div>
</td>
</tr>
</tbody>
</table>
This is working find except that I want to include *ngFor in order to loop on many elements. Any idea ?
Put this instead of the table row you want to repeat for each row
<tr *ngFor="for row of rows">
<td> {{row.id}} </td>
<td> {{row.date}} </td>
<td> {{row.desc}} </td>
<td> {{row.credit}} </td>
</tr>
(this code is not tested)
Update
Try this:
<table class="table table-condensed" *ngFor="let l of list_name" style="border-collapse:collapse;">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Description<th>
<th>Credit</th>
</tr>
</thead>
...
You can iterate over an array with your desired length

Accordion table only displays one row when clicked (bootstrap)

I made a table/accordion thing that has hidden rows that are only visible when you click the "header" row. Unfortunately, the table only displays a ONE row for each header you click.
jsfiddle
As you can see in the code, each header row (ex: "9 / Parts Inspection") has two sub rows that are hidden (ex: "9.1" and "9.2"). When you click, only the first one (9.1) appears, leaving the others (9.2 and any others I add) hidden when they are supposed to be shown.
I'm assuming it's a problem with the class/id names getting confused, but no matter what different names I give things, it still doesn't work.
<table id="tbl-sample-values" class="table table-condensed table-bordered table-hover" style="font-size:85%;">
<thead>
<tr class="tabletop">
<th>Step #</th>
<th>Processing Step</th>
<th>Barcode</th>
</tr>
</thead>
<tbody>
<tr data-toggle="collapse" data-target="#accordion" class="clickable row-header">
<td>9</td>
<td colspan="2">Parts Inspection</td>
</tr>
<tr id="accordion" class="collapse">
<td>9.1</td>
<td>Handle silicon electrodes...</td>
<td>[Barcode here]</td>
</tr>
<tr id="accordion" class="collapse">
<td>9.2</td>
<td>Verify part number...</td>
<td>[Barcode here]</td>
</tr>
<tr data-toggle="collapse" data-target="#accordion2" class="clickable row-header">
<td>10</td>
<td colspan="2">IPA Clean</td>
</tr>
<tr id="accordion2" class="collapse">
<td>10.1</td>
<td>Place part with frontside facing up...</td>
<td>[Barcode here]</td>
</tr>
<tr id="accordion2" class="collapse">
<td>10.2</td>
<td>Wipe the part using cleanroom wiper...</td>
<td>[Barcode here]</td>
</tr>
</tbody>
</table>
Give your tr's the same class instead of an unique id. Use this class as your data-target. For example:
<tr data-toggle="collapse" data-target=".my-row" class="clickable row-header">
<td>9</td>
<td colspan="2">Parts Inspection</td>
</tr>
<tr id="accordion" class="my-row collapse">
<td>9.1</td>
<td>Handle silicon electrodes...</td>
<td>[Barcode here]</td>
</tr>
<tr id="accordion" class="my-row collapse">
<td>9.2</td>
<td>Verify part number...</td>
<td>[Barcode here]</td>
</tr>
I hope this helps.

fixed/freeze header and columns inside scrollable div

this question may be duplicate but I did not got solution for my requirement.
I need a help to have fixed/freeze header and few first columns for table inside
the scrollable div element. The data is dynamic as i columns and rows may increase or decrease depends of Data source. Currently it having ~86 rows and ~55 columns. The columns width is dynamic based on data.
My HTML code looks as below.
<html>
<body ng-app="myapp" ng-controller="mycontroller">
<table style="width:100%; height:90%">
<tr>
<td width=3%> </td>
<td>
<table style="width:100%;">
<tr>
<td>Page header</td>
</tr>
<tr><td></td></tr>
</table>
<table style="width:100%; height:90%">
<tr>
<td>
<div ng-style="{'width': twidth + 'px', 'heigth':theight + 'px','overflow-x': 'auto','overflow-y': 'auto'}">
<table>
<thead ng-repeat="h in dummy| limitTo:1">
<tr>
<th ng-repeat="(key, val) in h">
{{key}}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="h in dummy">
<td ng-repeat="(key, val) in h">{{val}}</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Second <tr> causes table width to expand weirdly on large table

I am using the following HTML/Razor to create a details row for when the user clicks the Run App button. The primary row is 4 columns wide, and the details row spans the 4 columns.
Detail Row Hidden
Detail visible
Here the detail row causes the table to expand really weirdly, it's way to large. It's not center either for some reason.
Small Table looks correct
It all looks fine when I reduce the size of the table. It's centered correctly and doesn't look super wide.
This is the HTML and a Fiddle
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<table class="table table-hover table-responsive">
<thead>
<tr>
<th>Components</th>
<th>Name</th>
<th>Description</th>
<th>Options</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data Access,Querying</td>
<td>Basic Querying</td>
<td>Executes a stored procedure, fetching a single result set, without sending data in to the database.</td>
<td>
<button type="button" data-app="5625ad80-a1c7-4dfd-baeb-744d4de5292e" data-vm-required="False" class="btn btn-success">
Run App
</button>
</td>
</tr>
<tr class="">
<td colspan="4">
<div class="container">
<div class="alert alert-info" data-app="5625ad80-a1c7-4dfd-baeb-744d4de5292e">
<div class="container">
<span>
1000 items returned. Only showing the first 10 results.
<table class="table table-responsive">
<tbody>
<tr>
<th>PostalCode</th>
<th>City</th>
<th>AddressLine2</th>
<th>AddressLine1</th>
<th>AddressID</th>
</tr>
<tr>
<td>98011</td>
<td>Both</td>
<td></td>
<td>1970 Napa Ct.</td>
<td>1</td>
</tr>
<tr>
<td>98018</td>
<td>Bothell68</td>
<td></td>
<td>9833 Mt. Dias Blv.686</td>
<td>2</td>
</tr>
<tr>
<td>98011</td>
<td>Bothell</td>
<td></td>
<td>7484 Roundtree Drive</td>
<td>3</td>
</tr>
<tr>
<td>98011</td>
<td>Bothell</td>
<td></td>
<td>9539 Glenside Dr</td>
<td>4</td>
</tr>
<tr>
<td>85323</td>
<td>Phoenix</td>
<td></td>
<td>1226 Shoe St.</td>
<td>5</td>
</tr>
<tr>
<td>98011</td>
<td>Bothell</td>
<td></td>
<td>1399 Firestone Drive</td>
<td>6</td>
</tr>
<tr>
<td>98011</td>
<td>Bothell</td>
<td></td>
<td>5672 Hale Dr.</td>
<td>7</td>
</tr>
<tr>
<td>98011</td>
<td>Bothell</td>
<td></td>
<td>6387 Scenic Avenue</td>
<td>8</td>
</tr>
<tr>
<td>98011</td>
<td>Bothell</td>
<td></td>
<td>8713 Yosemite Ct.</td>
<td>9</td>
</tr>
<tr>
<td>98011</td>
<td>Bothell</td>
<td></td>
<td>250 Race Court</td>
<td>10</td>
</tr>
</tbody>
</table>
</span>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td>Data Access,Querying</td>
<td>Parameterized Query</td>
<td>Executes a stored procedure, fetching a single result set, filtered by a City passed into the stored procedure.</td>
<td>
<button type="button" data-app="544abdf8-3685-4865-84f5-3d8fd132dd75" data-vm-required="True" data-app-name="Parameterized Query" data-toggle="modal" data-target="#appParameters" class="btn btn-success">
Run App
</button>
</td>
</tr>
<tr class="hidden">
<td colspan="4">
<div class="container">
<div class="alert alert-info" data-app="544abdf8-3685-4865-84f5-3d8fd132dd75">
</div>
</div>
</td>
</tr>
</tbody>
</table>
What am I doing wrong with the table that's causing it to not look like the way it does at the smaller Window scale?
Remove container class here and it will work normally.
<div class="container">
<span>
1000 items returned. Only showing the first 10 results.

Collapsible div as a row element

I am trying to prepare a simple mark sheet [as an example to demonstrate my requirement]. Am planning to have a collapsible div which will render all the mark details once it is expanded.
<div class="well">
<table class="table table-bordered"
style="background:#fff; margin-bottom:10px;">
<tbody>
<tr class="inverse">
<th> ID</th>
<th colspan="2"> Name</th>
</tr>
<tr>
<td>1</td>
<td>ABC</td>
<td>
<a class="btn btn-primary" data-toggle="collapse" href="#ID_1"
aria-expanded="false" >
Hide/Unhide
</a>
</td>
</tr>
<tr>
<td colspan="3">
<div class="collapse" id="ID_1">
<div class="well">
<table class="table table-hover table-bordered" style="background:#fff; margin-bottom:10px;">
<thead>
<tr class="inverse">
<th>Subject</th>
<th>Mark</th>
</tr>
</thead>
<tbody>
<tr>
<td>Physics </td>
<td>100</td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
<tr class="inverse">
<th> ID</th>
<th colspan="2"> Name</th>
</tr>
<tr>
<td>2</td>
<td>PQR</td>
<td>
<a class="btn btn-primary" data-toggle="collapse" href="#ID_2"
aria-expanded="false" >
Hide/Unhide
</a>
</td>
</tr>
<tr>
<td colspan="3">
<div class="collapse" id="ID_2">
<div class="well">
<table class="table table-hover table-bordered" style="background:#fff; margin-bottom:10px;">
<thead>
<tr class="inverse">
<th>Subject</th>
<th>Mark</th>
</tr>
</thead>
<tbody>
<tr>
<td>Chemistry</td>
<td>100</td>
</tr>
</tbody>
</table>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
fiddle
But in this approach, when a section is not expanded, the row which encloses the collapsible div appears like a blank row in the table - which is quite misleading.
I am sure this is not the best way to render this sort of details.Would like to know what are the alternate UI options to render these details.
Use this CSS:
td[colspan="3"] {
padding: 0;
}
Fiddle