I'm making a page using bootstrap and angular. Fixed my layout thru BS and now working on angular. While trying to repeat an image via ng-repeat, I got into this cell border problem and not sure what to do.
<table class="table">
<tr>
<th colspan=2 class="text-center">Skill Level</th>
</tr>
<tr>
<th>Forehand: </th>
<td>
<img class="image star" src="img/star.png"/>
<img class="image star" src="img/star.png"/>
</td>
</tr>
<table class="table">
<tr>
<th colspan=2 class="text-center">Skill Level </th>
</tr>
<tr data-ng-repeat="skill in skillLevel">
<th>
{{ skill.skillName }}:
</th>
<td data-ng-repeat="i in makeArray(skill.value) track by $index">
<img class="image star" src="img/star.png"/>
</td>
</tr>
</table>
Got this makeArray function from a SO thread. I've tried setting min-width and max-width for the cell, yet no use. Can you help? Thanks.
$scope.skillLevel=[
{'skillName':'HTML', 'value': 1},
{'skillName':'CSS', 'value': 4},
{'skillName':'JS', 'value': 5},
{'skillName':'Bootstrap', 'value': 1}
];
$scope.makeArray=function(number) {
return new Array(number);
}
Change
<td data-ng-repeat="i in makeArray(skill.value) track by $index">
<img class="image star" src="img/star.png"/>
</td>
to
<td>
<img class="image star" src="img/star.png" data-ng-repeat="i in makeArray(skill.value) track by $index" />
</td>
The problem occured when you replicated the <td> cells instead of replicating the <img> images.
Related
I have a table that displays a list of uploaded files. If I uploaded a file it needs to be reflected in the table. This is already happening — not, however, in real-time. I need to refresh the page to reflect the data that I need.
I tried refreshing the div in jquery but it is not working:
<div class="mjs-cell">
<div id="stipsData" data-bind="template:{name: 'rehash-customertab-stips-section', data: stipsViewModel}">
</div>
</div>
<div class="mjs-row">
<table class="table table-striped table-bordered">
<tr>
<th>Stip Name</th>
<th>Status</th>
<th>File Name</th>
</tr>
<tbody data-bind="foreach: $data">
<tr class="stips-row">
<td class="hidden stips-id" data-bind="text: StipulationTypeId"></td>
<td class="stips-text">
<a data-bind="text: StipulationType"></a>
</td>
<td class="stips-status">
<span data-bind="text: Status"></span>
</td>
<td class="stips-uploaded-file" data-bind="text: FileName"></td>
</tr>
</tbody>
</table>
</div>
Here is the code that I use for binding:
stipsViewModel = ko.computed(function () {
DealApiControllers.GetStipulations(dealId,
(response) => {
this.stipsViewModel = response.DealStipulationsDTOs;
},
(error) => {
console.error(error);
});
}, this);
For example the table shows Doc1, Doc2. If I upload Doc3 it should be reflected in the list.
I'm trying to create (using Semantic-UI and knockoutjs) a data table where each row has an expandable item (accordion) to show a sub-table of data related to the expanded row.
I have tried to use colspan="4" on my sub-table's <td> element, to no avail. No matter what I try, the sub-table seems to only exist within the first column of the parent table. The jsfiddle below demonstrates the issue better than my description, I'm sure.
https://jsfiddle.net/xpvt214o/908333/
This may be a simple CSS issue -- I'm no expert -- but nothing I've tried works for me. I also tried wrapping the sub-table as a <div>, but that seemed to break the accordion from collapsing.
<table class="ui celled table accordion">
<thead><tr>
<th ></th>
<th >ID</th>
<th>Name</th>
<th >FK1 ID</th>
<th >FK2 ID</th>
</tr></thead>
<tbody data-bind="foreach: arrayVM">
<tr class="ui title">
<td><i class="dropdown icon"></i></td>
<td data-bind="text: id"></td>
<td data-bind="text: name"></td>
<td data-bind="text: fk1id"></td>
<td data-bind="text: fk2id"></td>
</tr>
<tr style="display:none">
<td colspan="5" class="ui content">
<table class="ui inverted celled table" style="width:700px">
<tbody>
<tr>
<td><i class="ui logo add icon"></i></td>
<td data-bind="text: id"></td>
<td>column2</td>
<td>column3</td>
<td>column4</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
I have following html which is used to render a PDF file, I need to render the <tfoot> section always at the bottom of every page even if the content of the page are small.
<div class="pdf-position-top pdf-content-center">
<table>
<thead>
<tr>
<th>
<div class="print-banner">
<span class="banner-text-repeat">Some Text</span>
</div>
</th>
</tr>
</thead>
#RenderSection("TableBody", required: true)
<tr>
<td>
<div class="pdf-content-center">#RenderBody()</div>
</td>
</tr>
<tfoot>
<tr>
<td>
<!--START print-banner top-->
<div class="print-banner">
<span class="banner-text-repeat">Some Text</span>
</div>
</td>
</tr>
</tfoot>
</table>
</div>
From documentation of header/footer
EO.Pdf.HtmlToPdf.Options.HeaderHtmlFormat = '<div class="print-banner">
<span class="banner-text-repeat">Some Text</span>
</div>'
I am using Ink to try and create an order confirmation e-mail from an ecommerce store. If I have a table that shows item info or any sort of data I layout, the last column is crunched to one character width when resizing to small. Example code in a 6-column cell is attached for code as well as the output screenshot.
Any ideas how I can fix this?
<table class="six columns">
<tr>
<td>
<table width="100%">
<tr>
<td>Subtotal</td>
<td>$60.00</td>
</tr>
<tr>
<td>Shipping & Handling</td>
<td>$11.91</td>
</tr>
<tr>
<td><strong>Grand Total</strong></td>
<td><strong>$71.91</strong></td>
</tr>
</table>
</td>
<td class="expander"></td>
</tr>
</table>
A Ink sub-grid would be useful here.
HTML
<table class="body">
<tr>
<td class="center" align="center" valign="top">
<div class="c1">
<table class="row">
<tr>
<td class="wrapper">
<table class="twelve columns">
<tr>
<td class="ten sub-columns">Subtotal</td>
<td class="two sub-columns last">$10</td>
<td class="expander"></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="row">
<tr>
<td class="wrapper">
<table class="twelve columns">
<tr>
<td class="ten sub-columns">S&H</td>
<td class="two sub-columns last">$2</td>
<td class="expander"></td>
</tr>
</table>
</td>
</tr>
</table>
<table class="row">
<tr>
<td class="wrapper">
<table class="twelve columns">
<tr>
<td class="ten sub-columns">Total</td>
<td class="two sub-columns last">$12</td>
<td class="expander"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
Screenshot
Here's the demo.
I think Ink is only for creating responsive e-mail layouts. If you want something more, you can use standard HTML. So <table> with <tr>, <td> and <th>.
JSFiddle: http://jsfiddle.net/ardave/8DR6n/3/
Full Screen JSFiddle: http://jsfiddle.net/ardave/8DR6n/3/embedded/result/
I've got these three divs at the bottom right of the page, each containing an html table with text, and it all displays fine at most desktop resolutions.
However, when I shrink my window horizontally, or when I view it on certain mobile devices, the tables' contents overlap each other.
This problem appears just as the window is sized below 979 pixels wide, which coincides with the bootstrap-responsive.css media query for tablet size, so I'm sure this is related, but I don't know enough to figure out how or why.
The problem also coincides with the width that the navbar across the top disappears, though again, I don't know enough to say how or why.
The only other possibly useful thing I've discovered is that when the window is sized so that the problem exists, when I hover over the span or table elements in the "Elements" debugger window in Chrome, I can clearly see that the tables' columns extend past the size of the tables themselves, and past the sizes of the span4 divs that contain the tables.
I don't really want the content to overflow visibly, which I think is the current problem, however I also don't want to hide or scroll the overflow. I'd really just like the table text to stay at a non-overlapping size until the tables/span4s are forced to respond responsively by stacking on top of each other once the screen gets too narrow.
Any help would be greatly appreciated.
It seems possibly excessive, but I guess SO wants me to include the code itself rather than just the links to jsfiddle, so here goes (assume that bootstrap.css and bootstrap-responsive.css are referenced)
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">View All</li>
<li>View All
</li>
</ul>
</div>
</div>
<div class="span9">
<div class="hero-unit">
<h1>My Site Name</h1>
<p>Introductory stuff</p>
<p> <a class="btn btn-primary btn-large" href="/Home/About">About »</a>
</p>
</div>
<div class="container">
<div class="row-fluid">
<div class="span4">
<h2>Newest Entries</h2>
<table class="table .table-bordered">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>1/28/2013</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>12/4/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>11/9/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>10/31/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>10/31/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>10/30/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>10/17/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>10/15/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>9/29/2012</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>9/21/2012</td>
</tr>
</table>
</div>
<!--/span-->
<div class="span4">
<h2>Latest Stuff</h2>
<table class="table .table-bordered">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
</tr>
</thead>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>11/9/2012</td>
<td>10.0</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>11/7/2012</td>
<td>8.0</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>11/4/2012</td>
<td>10.0</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>10/11/2012</td>
<td>7.0</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>9/13/2012</td>
<td>9.0</td>
</tr>
<tr>
<td> Lots of stuff
</td>
<td> Lots of stuff
</td>
<td>9/6/2012</td>
<td>7.0</td>
</tr>
</table>
</div>
<!--/span-->
<div class="span4">
<h2>Needing Inputs</h2>
<table class="table .table-bordered">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>1/28/2013</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>12/4/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>11/18/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>11/9/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>11/7/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>11/5/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>10/31/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>10/30/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>10/30/2012</td>
<td> Lots of stuff
</td>
</tr>
<tr>
<td>Here's a thing</td>
<td> Lots of stuff
</td>
<td>10/18/2012</td>
<td> Lots of stuff
</td>
</tr>
</tbody>
</table>
</div>
<!--/span-->
</div>
</div>
<div>
<p></p>
<p>Here's a big blob of text!</p>
</div>
</div>
</div>
<hr>
<footer>
<p>© Some Company</p>
</footer>
</div>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<div class="nav-collapse collapse"> <a class="brand" href="/">TheSiteName.com</a>
<form action="/Search/Search"
class="navbar-search pull-left" method="get">
<input type="text" class="search-query" placeholder="Search by Name" name="SearchQuery"
/>
</form>
<form ReturnUrl="" action="/Account/ExternalLogin" class="navbar-form pull-right"
method="post">
<button type="submit" name="provider" value="facebook" class="logonpartialextlogin"
title="Log in using your Facebook account">
<img src="/Images/facebook.png" />
</button>
<button type="submit" name="provider" value="twitter" class="logonpartialextlogin"
title="Log in using your Twitter account">
<img src="/Images/twitter-bird-white-on-blue.png" />
</button>
<button type="submit" name="provider" value="google" class="logonpartialextlogin"
title="Log in using your Google account">
<img src="/Images/google-icon.png" />
</button>
</form>
<form action="/Account/Register" class="navbar-form pull-right" method="get">
<button type="submit" class="btn">Register</button>
</form>
<form action="/Account/LogOn" class="navbar-form pull-right" method="post">
<input class="span2" type="text" placeholder="Email" name="UserName" />
<input class="span2" type="password" placeholder="Password" name="Password"
/>
<button type="submit" class="btn">Sign in</button>
</form>
</div>
</div>
</div>
</div>
I know this thread is several months old, but I also know that I really appreciate when someone posts an answer that worked for their similar situation. Here's the way I did it in bootstrap 2 and 3.
.cw-table-list{
margin:0px !important;
table-layout:fixed;
}
.cw-table-list td{
padding-bottom: 0px !important;
overflow:hidden;
}
Hope this helps.
Twitch
I can't tell you the "Bootstrap way" to fix this, since I don't use it. I can tell you the why: Your content doesn't allow it at that breakpoint.
Because rows of tables don't wrap around (ie. all of the cells for each row must appear on the same line), there is an absolute minimum width that every given table can resize down to, which depends on things like paddings and the widest non-wrapping content for each cell. For your tables, the smallest they can go is whatever the width of "Column", "Column", and "10/11/2012" equal out to plus 48px (8px padding on each side times 3).
The span4s are only allowed to be 31.49% of 724px (definition on .container ancestor element), which isn't wide enough to contain the tables at their smallest possible width.
My recommendation would be to not try and place all 3 tables side by side. Your display would have to be exceptionally wide in order for it to not look cramped and not have horizontal scrolling.
You can apply the style = "overflow: auto;" to put a horizontal scroll bar at your table. Thus the design will still remain responsive. Follow the code:
.table-scrollable{
overflow: auto;
}
And use it on your parent div:
<div class='table-scrollable'>
Assign the table's container element with overflow: auto; and the table itself with table-layout: fixed;
.ie-table-fix {
overflow: auto;
}
.ie-table-fix > table {
table-layout: fixed;
}