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

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.

Related

Make a new line inside a row html table

I am currently learning HTML table, I want to my HTML table looks like this .
How do i create a table in html like that? What's wrong with my code? Link to my full code
<section class="container">
<table class="order-table table">
<thead>
<tr>
<th>NAME</th>
<th>EMAIL</th>
<th>ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
<td>john#john.com</td>
<td>0001</td>
</tr>
<tr>
<td>Jane</td>
<td>jane#jane.com</td>
<td>0002</td>
<tr>
<td><i class="mdi mdi-subdirectory-arrow-right"></i>Doe</td>
<td>doe#doe.com</td>
<td>0002a</td>
</tr>
<tr>
<td><i class="mdi mdi-subdirectory-arrow-right"></i>Allan</td>
<td>allan#allan.com</td>
<td>0002b</td>
</tr>
<tr>
</tr>
<tr>
<td>Smith</td>
<td>smith#smith.com</td>
<td>0003</td>
</tr>
</tbody>
</table>
</section>

collapsable content not indenting

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>

HTML table cell issue

I am brand new to front end HTML and trying to construct a table identical to the below example whereby I have cell numbering identical to this.
My code as it stands when rendered looks like this.
I am struggling to figure out how I achieve the cell numbering. I have done a few things but it looks out of sorts. Is this done via colspan.
<table border="1">
<tr>
<td>Bruce Springsteen Born To Run</td>
<td><img src="images/borntorun.jpg" alt="bruce springsteen"></td>
</tr>
<tr>
<td>Thunder Road</td>
<td>4.47</td>
</tr>
<tr>
<td>10th Avenue Freeze Out</td>
<td>3.10</td>
</tr>
<tr>
<td>Night</td>
<td>3.00</td>
</tr>
<td>Backstreets</td>
<td>6.29</td>
</tr>
<tr>
<td>Born To Run</td>
<td>4.29</td>
</tr>
<tr>
<td>She's the one</td>
<td>4.29</td>
</tr>
<tr>
<td>Meeting Across The River</td>
<td>3.15</td>
</tr>
<tr>
<td>Jungleland</td>
<td>9.33</td>
</table>
<table border="1">
<tr>
<td>1</td>
<td>Bruce Springsteen Born To Run</td>
<td><img src="images/borntorun.jpg" alt="bruce springsteen"></td>
</tr>
<tr>
<td>2</td>
<td>Thunder Road</td>
<td>4.47</td>
</tr>
<tr>
<td>3</td>
<td>10th Avenue Freeze Out</td>
<td>3.10</td>
</tr>
<tr>
<td>4</td>
<td>Night</td>
<td>3.00</td>
</tr>
<td>5</td>
<td>Backstreets</td>
<td>6.29</td>
</tr>
<tr>
<td>6</td>
<td>Born To Run</td>
<td>4.29</td>
</tr>
<tr>
<td>7</td>
<td>She's the one</td>
<td>4.29</td>
</tr>
<tr>
<td>8</td>
<td>Meeting Across The River</td>
<td>3.15</td>
</tr>
<tr>
<td>9</td>
<td>Jungleland</td>
<td>9.33</td>
</table>
You can use this and add 1 column to it and you can get what you want.
You can use Bootstrap and make it responsive as well, if you need more info search here, example:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-6" style="background-color:yellow;">
Bruce Springsteen Born To Run
</div>
<div class="col-xs-6" style="background-color:pink;">
<img src="images/borntorun.jpg" alt="bruce springsteen">
</div>
</div>
<div class="row">
<div class="col-xs-2" style="background-color:yellow;">
1
</div>
<div class="col-xs-5" style="background-color:pink;">
Thunder Road
</div>
<div class="col-xs-5" style="background-color:pink;">
4.47
</div>
<div class="col-xs-2" style="background-color:yellow;">
2
</div>
<div class="col-xs-5" style="background-color:pink;">
10th Avenue Freeze Out
</div>
<div class="col-xs-5" style="background-color:pink;">
3.10
</div>
</div>
</div>
</body>
</html>
You can use colspan to do it.
<table border="1" width="100%">
<tr>
<td colspan="2">Bruce Springsteen Born To Run</td>
<td><img src="http://www.trait-tech.com/uploads/T-TOOL-9406__Acrylic-Mirror-Effect-3d-Wall-Decals-Flower-Shaped-Mirrors-Stickers-Pack-of-5-Set-for-Halloween-Chirstmas-Valentine-.jpg" alt="bruce springsteen"></td>
</tr>
<tr>
<td>1</td>
<td>Thunder Road</td>
<td>4.47</td>
</tr>
<tr>
<td>2</td>
<td>10th Avenue Freeze Out</td>
<td>3.10</td>
</tr>
<!--Other rows here-->
</table>

Footable pagination and sorting is not working

First i setup jquery, bootstrap libs and then include footable.min.js, footable.paging.js and footable.sorting.min.js files and also setup stylesheets for that.
So, i can't to use sorting as well as pagination on it.
i am not getting any kind of error in console. whereas i able to used data-breakpoints for various devices and it works for me. i don't know how one features is working and another is not. please help me.
html file
<div class="container-fluid">
<div class="page-header">
<table class="footable table table-hover" data-page-size="3" data-page-navigation=".pagination">
<thead>
<tr>
<th data-toggle="true">Name</th>
<th data-breakpoints="xs sm">Birthday</th>
<th data-breakpoints="xs">City</th>
<th>Donation</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sade Morgan</td>
<td>10/03/1990</td>
<td>Ede</td>
<td>$4,653</td>
</tr>
<tr>
<td>Knox Sutton</td>
<td>06/29/1966</td>
<td>Bressoux</td>
<td>$4,563</td>
</tr>
<tr>
<td>Rooney Preston</td>
<td>12/12/2002</td>
<td>Patalillo</td>
<td>$3,222</td>
</tr>
<tr>
<td>Fulton Wilkerson</td>
<td>01/24/1986</td>
<td>Haren</td>
<td>$2,841</td>
</tr>
<tr>
<td>Azalia Long</td>
<td>11/21/1988</td>
<td>Gressoney-Saint-Jean</td>
<td>$4,631</td>
</tr>
<tr>
<td>Erich Burris</td>
<td>10/26/1966</td>
<td>Pulle</td>
<td>$2,519</td>
</tr>
<tr>
<td>Kadeem Sharpe</td>
<td>08/24/1976</td>
<td>Ekeren</td>
<td>$1,440</td>
</tr>
<tr>
<td>Rose Wilcox</td>
<td>11/05/2003</td>
<td>Aparecida de GoiĆ¢nia</td>
<td>$2,188</td>
</tr>
<tr>
<td>Hu Gibson</td>
<td>02/18/1994</td>
<td>Raigarh</td>
<td>$4,286</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-center">
<ul class="pagination"></ul>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
<script>
$(document).ready(function() {
$(".footable").footable();
});
</script>

Bootstrap table two horizontal columns of varied lengths in each row

I have a table I decorated with bootstrap.
Here is the simple table view (collapsed).
Each table row has two horizontal sets of data. So the expanded view for each row shows up when the "Details" button is clicked. Here's the expanded view.
The first set of data of each row has 4 columns. While I'd like the second set of data of the same row to fully occupy the whole table width.
The problem is that the way I did it doesn't feel the best way to do it.
I pretty much used Angular loop construct to repeat the <tr>. I then embedded two tables per <tr> so that I can display the first data set in the first table and the expanded view in the second table. Clicking on the "Details" button shows the second set (table) of data of row.
<table class="table-hover table-condensed">
<!--<table class="table">-->
<thead>
<tr>
<th align="left" class="span2">Date</th>
<th align="left" class="span2">Title</th>
<th align="left" class="span2">Bill Total</th>
<th align="left" class="span4">Options</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="ibill in user.groups[0].bills | filter:query | orderBy:'date'">
<td colspan="4">
<table>
<tr>
<td class="span2">{{ ibill.billDate | date:'MM/dd/yyyy'}}</td>
<td class="span2">{{ ibill.title }}</td>
<td class="span2">${{ ibill.billTotal }}</td>
<td class="span4">
<!-- <a ng-click='deleteBill(ibill.id)'><i class="icon-trash "></i></a>
<i class="icon-pencil "></i>--> <a ng-click='deleteBill(ibill.id)' class="btn btn-mini" ng-init="ibill.isCollapsed = 'true'" ng-click="ibill.isCollapsed = !ibill.isCollapsed"><i class=" icon-trash"></i></a>
<i class="icon-edit"></i>
<a class="btn btn-mini" ng-init="ibill.isCollapsed = 'true'" ng-click="ibill.isCollapsed = !ibill.isCollapsed"><i class="icon-eye-open"></i> details</a>
<!--<a class="btn" ng-init="ibill.isCollapsed=' true'" ng-click="ibill.isCollapsed=! ibill.isCollapsed"><i class="icon-folder-open "></i> Details</a>-->
</td>
</tr>
</table>
<table>
<tr>
<td colspan="4">
<div collapse="ibill.isCollapsed">
<div>
<p ng-repeat="simplecost in ibill.billSimpleEntry.simpleUserIdAndLiableCost">{{simplecost.user.fName}} owes ${{simplecost.liableCost}}</p>
</div>
</div>
</td>
</tr>
</table>
</td>
<!--<td>{{ibill}}</td>-->
</tr>
<!-- <tr>
<td><div collapse="ibill.isCollapsed">
<div class="well well-large">Some content</div>
</div></td>
</tr>-->
</tbody>
</table>
I'm pretty much e
<table>
<thead></thead>
<tbody>
<tr>
<td></td>
</tbody>
</table>
Is it possible to do the same with a table-less design (eliminating two tables per row)
You could just use the colspan attribute on a td to achieve the same effect without the tables. Ex:
<table>
<tbody>
<tr> <!--normal row stuff-->
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan='4'><!--details stuff here--></td>
</tr>
</tbody>
</table>
In this example, the td with colspan='4' will be a single cell that is the same width as the 4 cells in the previous row.