I have the following markup(using AngularJS):
<div class="col-sm-12" id="stack-table-container" style="padding:0px">
<table class="col-sm-12 table-bordered">
<tbody>
<tr ng-repeat="grid in grids">
<td class="bold" style="text-align:center;width:10% !important"> {{grid.Left}}
<div>
({{grid.Count}})
</div>
</td>
<td style="width:90%">
<div stack-bar dataid="grid.Left.substring(0, 2)+ '_' + $index" data="grid.Inner" type="barType" companydata="grid.Count_dict">
<div id="{{grid.Left.substring(0, 2)}}_{{$index}}">
<svg style='height:200px'> </svg>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
I am planning to set the SVG's width dynamically according to the data passed to the angular directive 'stack-bar'.
As you can see each row in the table has a variable width multibar chart plotted using the angular directive.
The problem I am facing is that some rows may exceed the width of the table due to the SVG's(which is wrapped in the second 'td' of the row) width. Consequentially, I want such rows to have a individual horizontal scrollbars.
I tried setting a fixed width to each row and applied overflow-x: scroll to the second 'td' which contains the bar chart. But this doesn't work. Any suggestions on what I can do? Should I not use a table?
Well, turns out not using a table was a good idea. Here's the new markup:
<div class="col-sm-12" id="stack-table-container" style="padding:0px">
<div ng-repeat="grid in grids" class="row">
<div class="col-sm-2" style="padding-top:70px;text-align:center">
<div>
<span>{{grid.Left}}</span>
</div>
<div>
<span>({{grid.Count}})</span>
</div>
</div>
<div class="col-sm-10" stack-bar dataid="grid.Left.substring(0, 2)+ '_' + $index" data="grid.Inner" type="barType" companydata="grid.Count_dict">
<div id="{{grid.Left.substring(0, 2)}}_{{$index}}" style="overflow-x:scroll"> //scroll here
<svg style='height:200px'> </svg>
</div>
</div>
</div>
</div>
However, I would still like to see a solution with the table!
Related
I'm trying to use jquery in order to replicate the styling from another description tab that uses a table.
This is the current code of what I want to apply the script on:
<table class="shop_attributes">
<div class="iconic-cffv-field" data-field-id="iconic_cffv_2599_product_size">
<strong class="iconic-cffv-field__label iconic-cffv-field__label--above">product_size</strong>
<div class="iconic-cffv-field__content"><p>66 x 81 x 77</p></div>
</div>
<div class="iconic-cffv-field" data-field-id="iconic_cffv_2599_product_weight">
<strong class="iconic-cffv-field__label iconic-cffv-field__label--above">product_weight</strong>
<div class="iconic-cffv-field__content"><p>146</p></div>
</div>
</table>
</div> </div>
This is what I'm trying to replicate:
<div class="cPanel cPanel--additional_information cPanel--ord-3">
<div class="cPanel-inner">
<h2>More Details</h2>
<table class="woocommerce-product-attributes shop_attributes">
<tbody><tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--weight">
<th class="woocommerce-product-attributes-item__label">Weight</th>
<td class="woocommerce-product-attributes-item__value" data-o_content="N/A">164 lbs</td>
</tr>
</tbody></table>
</div> </div>
I've tried the following to start off with but can't seem to have any of the tags apply at all
(function($) {
// Wrap attributes into table format
$(".iconic-cffv-field__label.iconic-cffv-field__label--above").wrapAll("<th></th>");
$(".iconic-cffv-field__content").wrapAll("<td></td>");
}
Whats up! I have a question - maybe banal, maybe not. I need to remove the HTML code to a file after generating it in the component. And everything would be cool, if not for the fact that if I do it
document.getElementById ('summary').outerHTML
or
this.summaryReport.nativeElement.innerHTML
I`ve
#ViewChild('summaryReport') summaryReport: ElementRef;
html:
<div #summaryReport id="summary" class="summary">
<div class="row border border-secondary">
<div class="col-md">
<h2> Podsumowanie sprzedaży biletów </h2>
</div>
</div>
<div class="row">
<ng-container *ngFor="let d of sortedData |keyvalue">
<div class="row">{{d.key}}</div>
<div class="col-md">
<table class="table">
<thead>
<th>{{'Ticket name'|translate}}</th>
<th>{{'Price'|translate }}</th>
<th>{{'Quantity'|translate}}</th>
</thead>
<tbody>
<tr *ngFor="let el of d.value">
<td>{{el.ticketName}}</td>
<td>{{el.price / 100}}</td>
<td>{{el.quantity}}</td>
</tr>
</tbody>
</table>
</div>
</ng-container>
</div>
</div>
</div>
in the verse I get 'bindings = {}' in place of ngFor.
Can anyone tell me what I do not understand?: D
I`ve answer.
Time....
I'm trying to generate a variable too quickly. After added another method to send html , work fine
My intention is to align the boxplot with the textual content.
Here is the page of my BOXPLOT visualization
The following is the html code that makes the page appear, where the visulization is represented by the id boxplot. Demo.
I can invert the visualization but I cannot align it with the textual content. I looked up the bootstrap settings and placed it in different locations, but it always ended up coming in front of the text. I am not well-versed with css styling. Can anybody help?
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script><script src="https://code.highcharts.com/modules/exporting.js"></script>
<div class="container">
<h1>Where's the plag?</h1>
<div class="jumbotron">
<small>
<p>Atom Type: paragraph </p>
<p>Cluster Method: kmeans </p>
<p>k: 2 </p>
Stylistic Feature(s):
<p>honore_r_measure </p>
<p></p>
</small>
<br>
<div id='chart' style="height: 300px; width: 20000px"></div>
<br>
<button type="button" class="btn btn-primary btn-sm" data-toggle="collapse" data-target="#full_table">
Hide/Show Table
</button>
<div class="row collapse in" id="full_table">
<div class="col-md-9">
<div class="table-responsive" style="font-size:12px;">
<table class="table table-condensed table-scrollable table-bordered">
<thead>
<tr>
<th>Start Index</th>
<th>honore_r_measure</th>
<th>Suspicion Score</th>
</tr>
</thead>
<tbody>
<tr class="passage_starting_at_">
<td class="passage_row"> 0</td>
<td class="passage_row"> 2512.6585</td>
<td class="passage_row">0.0000</td>
</tr>
<tr class="passage_starting_at_">
<td class="passage_row"> 196</td>
<td class="passage_row"> 2115.8163</td>
<td class="passage_row" bgcolor=#F60C0C> 1.0000</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<br class="col-md-9">
<div class="panel panel-default">
<!-- Change the id of the following div to either column or boxplot, whichever is required-->
<div id="boxplot" style="height: 300px; width: 750px"></div>
<div class="panel-heading">
easy_source
</div>
<div class="panel-body" id="document_content">
<p>
<div class="passage" features="<p>Span</p><p>0, 194</p><hr size = "10"<p>Plag. conf.</p><p>0.0</p><hr size = "10"<p>PLAG SPAN</p><p>No plag!</p><hr size = "10"<p>honore_r_measure</p><p>2512.6585</p><hr size = "10""
style="font-size:14px;display:inline;;color:rgb(0,0,0);" id='pass0'>
This is a really short source that isn't all that super exciting. It should have some nice fingerprints that hopefully match its plagiarized copy which is named easy_test.txt. Pretty cool stuff.
</div>
<br/>
<div class="passage" features="<p>Span</p><p>196, 379</p><hr size = "10"<p>Plag. conf.</p><p>1.0</p><hr size = "10"<p>PLAG SPAN</p><p>No plag!</p><hr size = "10"<p>honore_r_measure</p><p>2115.8163</p><hr size = "10""
style="font-size:14px;display:inline;color:rgb(255,0,0);" id='pass1'>
It also has another couple of lines which are not in the test document but are also here and are very exciting. This will make jaccard similarity not quite 1.0 but probably about 0.6.
</div>
<br/>
</div>
</div>
</div>
</div>
basically, I want the diagram to be like this
I am trying to create an application using bootstrap and angularjs as practice and a simplified version of my application is illustrated in this pen: http://codepen.io/megadeen/pen/ZWrGmv
This is the main code:
<table class="main" ng-app="app" ng-controller="main">
<tr>
<td class="sidebar">
<!-- Set page using AngularJS -->
<a ng-click="page = 'fpage'">First Page</a>
<br>
<a ng-click="page = 'spage'">Second Page</a>
</td>
<td class="content">
<!-- First Page -->
<div class="fpage" ng-show="page == 'fpage'">
<div class="col-md-5">
.... Content ....
</div>
</div>
</div>
<!-- Second Page -->
<div class="spage" ng-show="page == 'spage'">
<div class="row">
<div class="col-md-7">
.... Content ....
</div>
</div>
</td>
</tr>
</table>
However, there's always this stray horizontal scrollbar that won't go away. This stray scrollbar only appears in the second and subsequent pages.
I tried adding the row class to the fpage and spage divs. However, if I do so, then the scrollbar appears in all pages.
Why does this happen and how do I correct this problem?
You should use col-md-12 instead of row.
I've been recently introduced to bootstrap and I'm trying to make a table but for some reason, if I put my table inside a panel, the borders on the top,left,right,bottom suddenly disappears and I'm not sure what's causing this.
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<br>
<table class='table table-striped table-bordered'>
<tr>
<td width='12%'>
<b>Message Title:</b>
</td>
<td>
Title
</td>
</tr>
<tr>
<td>
<b>Message Body:</b>
</td>
<td>
Body
<br /><br />
<h6><b>Created By:</b> John | <b>Created On:</b> February 13, 2015 3:45pm </h6>
</td>
</tr>
</table>
<hr>
<table class='table table-striped table-bordered'>
<tr>
<td width='12%'>
<b>Message Title:</b>
</td>
<td>
Title
</td>
</tr>
<tr>
<td>
<b>Message Body:</b>
</td>
<td>
Body
<br /><br />
<h6><b>Created By:</b> John | <b>Created On:</b> February 15, 2015 1:23pm </h6>
</td>
</tr>
</table>
<hr>
</div>
</div>
</div>
</div>
I would put a picture but it says I need 10 reputation points but I do hope you get my problem. If I remove the panel, the tables' borders suddenly appear.
You can use that style.
<div class="panel panel-default">
<div class="panel-heading">
Panel heading without title
</div>
<div class="panel-body">
Table content
</div>
</div>
From the bootstrap docs regarding panels:
Add any non-bordered .table within a panel for a seamless design. If there is a .panel-body, we add an extra border to the top of the table for separation.
You can use tables within panels, but not within panel-body or panel-heading as they will be displayed with separated borders, what is mostly not intended.
I've provided some working bootply examples to show default usage.
EDIT:
Also, panels are not designed to hold multiple tables, but for your use case you may simply want to add additional table rows instead of additional tables.
See the results in the additional bootply sample.