How to align p-table and p-chart elements side by side - css

I have a very little experience developing UI but I wanted to accomplish a task quickly where I have to put a p-table and p-chart elements side by side. I tried to use flex layout as well as float left and right as below but not getting the expected result. How can this be fixed?
<div fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="50%" class="floatLeft">
<p-table [value]="summaryList" [scrollable]="true" scrollHeight="200px"
[resizableColumns]="true" [style]="{width:'500px'}">
<ng-template pTemplate="caption">
XXX Summary
</ng-template>
<ng-template pTemplate="header">
<tr>
<th *ngFor="let col of summaryColumns" [pSortableColumn]="col.field">
{{col.header}}
<p-sortIcon [field]="col.field"></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-summaryList>
<tr>
<td *ngFor="let col of summaryColumns">
{{summaryList[col.field]}}
</td>
</tr>
</ng-template>
</p-table>
</div>
<div class="col-md-4 content-section implementation" fxFlex="50%" class="floatRight">
<p-chart type="line" [data]="dailyData" title="XXX Chart" extender="overrideXAxis"></p-chart>
</div>
</div>

You can try doing this.
<div class="container">
<p-table [value]="summaryList" height="200" [scrollable]="true" scrollHeight="100px" [resizableColumns]="true" [style]="{width:'50%', float:'left'} ">
<ng-template pTemplate="caption">
My Awesome Summary
</ng-template>
<ng-template pTemplate="header">
<tr>
<th *ngFor="let col of summaryColumns" [pSortableColumn]="col.field">
{{col.header}}
<p-sortIcon [field]="col.field"></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-summaryList>
<tr>
<td *ngFor="let col of summaryColumns">
{{summaryList[col.field]}}
</td>
</tr>
</ng-template>
</p-table>
<p-chart height="250" [responsive]="false" type="bar" [data]="data" [options]="options" [style]="{width:'48%', float:'right'}"></p-chart>
</div>
then add style to your component.css
.container{
display: flex;
justify-content: center;
align-items: center;
}

Related

Adding scrollbar to p-overlayPanel

I have p-overlayPanel which has inside a table that can be very big and apears on all the screen, how can I add scrollbar?
Thanks
<button pButton
type="button"
icon="pi pi-angle-down"
(click)="op.toggle($event)"
iconPos="left"
label="גרסאות קודמות"
[disabled]="!isShowVersionValid()"
class="ui-button-rounded ui-button-secondary"></button>
<p-overlayPanel #op [showCloseIcon]="false" [style]="{'overflow':'visible', 'padding': 0 ,'border':'none'}">
<p-table [columns]="cols" [value]="data">
<ng-template pTemplate="header" let-columns>
<tr>
<th class="ui-column-title thdesign" *ngFor="let col of columns">
{{col.header}}
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-data let-columns="columns" let-rowIndex="rowIndex" >
<tr *ngIf="data.docVersionNumber < length">
<td *ngFor="let col of columns ">
<div *ngIf="!col.isAnchor && !col.isDate" class="colDesign">{{data[col.field]}}</div>
<div *ngIf="col.isDate" class="colDesign">{{ data[col.field] | date: "dd/MM/yyyy HH:mm"}}</div>
<div *ngIf="col.isAnchor && !col.isDate">
<a class="anchor" href="{{templateUrl}}?{{splitCoimPath(data.coimId)}}" target="_blank" rel="noopener noreferrer">
{{data[col.field]}}
</a>
</div>
</td>
</tr>
</ng-template>
</p-table>
</p-overlayPanel>
You can Use overflow:scroll instead of visible :
<p-overlayPanel #op [showCloseIcon]="false" [style]=" {width:'650px','max-height':'550px', overflow:'scroll', 'padding': 0 ,'border':'none'}">

descendant selector not working for .v-data-table th {*some style*}

I have a v-data-table with table headers and the styling is inside the .vue component. When I use the following style
.v-data-table-header th {
white-space: nowrap;
}
Nothing happens to the table headers. I have also tried other css like background and text colors and nothing is happening. I checked the dev tools and there are definitely th elements and it doesn't seem like the style is being overridden by anything since it's not even showing up in the styles tab of the dev tools. If i just use .v-data-table-header the style is applied. What could be going on here?
edit:
here is the vue code
<v-expansion-panel>
<v-expansion-panel-header>
Example header
</v-expansion-panel-header>
<v-expansion-panel-content>
<v-data-table
:headers="someHeaders"
:items="someItems"
/>
</v-expansion-panel-content>
</v-expansion-panel>
Here is the html for the table:
<div class="v-expansion-panel-content__wrap">
<div data-v-7037ec41="" class="v-data-table v-data-table--has-bottom theme--light">
<div class="v-data-table__wrapper">
<table>
<colgroup>
<col class="">
<col class="">
<col class="">
</colgroup>
<thead class="v-data-table-header">
<tr>
<th role="columnheader" scope="col" aria-label="Name: Not sorted. Activate to sort ascending."
aria-sort="none" class="text-start sortable"><span>Name</span><i aria-hidden="true"
class="v-icon notranslate v-data-table-header__icon material-icons theme--light"
style="font-size: 18px;">arrow_upward</i></th>
<th role="columnheader" scope="col" aria-label="Path: Not sorted. Activate to sort ascending."
aria-sort="none" class="text-start sortable"><span>Path</span><i aria-hidden="true"
class="v-icon notranslate v-data-table-header__icon material-icons theme--light"
style="font-size: 18px;">arrow_upward</i></th>
<th role="columnheader" scope="col"
aria-label="Message: Not sorted. Activate to sort ascending." aria-sort="none"
class="text-start sortable"><span>Message</span><i aria-hidden="true"
class="v-icon notranslate v-data-table-header__icon material-icons theme--light"
style="font-size: 18px;">arrow_upward</i></th>
</tr>
</thead>
<tbody>
<tr class="">
<td class="text-start">r3_ibmmq_jms_0.1</td>
<td class="text-start">Routes/MICROSERVICE</td>
<td class="text-start">cMQConnectionFactory component
"cMQConnectionFactory_1":MQTT_RECONNECT_DELAY of cMQConnectionFactory was changed to 10</td>
</tr>
<tr class="">
<td class="text-start">r4_ibmq_jms_job_0.1</td>
<td class="text-start">Routes/MICROSERVICE</td>
<td class="text-start">cMQConnectionFactory component
"cMQConnectionFactory_1":MQTT_RECONNECT_DELAY of cMQConnectionFactory was changed to 10</td>
</tr>
</tbody>
</table>
</div>
<div class="v-data-footer">
<div class="v-data-footer__select">Rows per page:<div
class="v-input v-input--hide-details v-input--is-label-active v-input--is-dirty theme--light v-text-field v-text-field--is-booted v-select">
<div class="v-input__control">
<div role="button" aria-haspopup="listbox" aria-expanded="false" aria-owns="list-101"
class="v-input__slot">
<div class="v-select__slot">
<div class="v-select__selections">
<div class="v-select__selection v-select__selection--comma">10</div><input
aria-label="Rows per page:" id="input-101" readonly="readonly" type="text"
aria-readonly="false" autocomplete="off">
</div>
<div class="v-input__append-inner">
<div class="v-input__icon v-input__icon--append"><i aria-hidden="true"
class="v-icon notranslate material-icons theme--light">arrow_drop_down</i>
</div>
</div><input type="hidden" value="10">
</div>
<div class="v-menu">
<!---->
</div>
</div>
</div>
</div>
</div>
<div class="v-data-footer__pagination">1-2 of 2</div>
<div class="v-data-footer__icons-before"><button type="button" disabled="disabled"
class="v-btn v-btn--disabled v-btn--icon v-btn--round v-btn--text theme--light v-size--default"
aria-label="Previous page"><span class="v-btn__content"><i aria-hidden="true"
class="v-icon notranslate material-icons theme--light">chevron_left</i></span></button>
</div>
<div class="v-data-footer__icons-after"><button type="button" disabled="disabled"
class="v-btn v-btn--disabled v-btn--icon v-btn--round v-btn--text theme--light v-size--default"
aria-label="Next page"><span class="v-btn__content"><i aria-hidden="true"
class="v-icon notranslate material-icons theme--light">chevron_right</i></span></button>
</div>
</div>
</div>
</div>
I figured out the issue. The vue component was using 'scoped' styles which stops styling from applying to child components. I removed the scoped from <style scoped> and now it works as expected.

angularjs grid list top alignment

I am trying top align the table within my grid list so all the tables across the rows line up.
I am using layout="column" layout-align="start center"> base on https://material.angularjs.org/latest/layout/alignment#layout-row-layout-align-center-center.
However, it is not still not working, the tables are center align rather than top align.
Any suggestion?
<md-content>
<md-grid-list md-cols="3" md-gutter="1em" md-row-height="2:1" >
<md-grid-tile ng-repeat="user in users" class="curvetable2" layout="column" layout-align="start center">
<md-grid-tile-header class="curvetable3" >
<h3><a style="color:white" ng-click="userCompletedCoursesDisplay(user.username, user.name)">{{user.name}}</a> <a ng-if="user.ismanager == 'yes'" style="color:#ffff99" ng-click="directManager(user.username, user.name)"> Manager - View Team</a></h3>
</md-grid-tile-header>
<div style="width:90%;">
</br></br>
<table style="width:100%;" >
<tr ng-repeat="course in user.course">
<td valign="top"><a ng-click="courseDisplay(course.id, user.username, 'organization')">{{course.name}}</a></td>
<td valign="top">{{course.date}} </td>
</tr>
<tr ng-if="user.more==true">
<td valign="top"><a ng-click="userCompletedCoursesDisplay(user.username, user.name)">Additional Courses</a></td>
</tr>
</table>
</div>
</md-grid-tile>
</md-grid-list>
</md-content>

How to freeze columns in ngtable and create a scroll bar for the rest of the columns in the table?

I have a data table in my AngularJS application which has many columns where the responsiveness doesn't work anymore. I am currently scrolling the whole way through the data table, which doesn't look good.
I am trying to find a way to freeze some columns on the right side of the data table so that the scroll will be only for the columns on the left. The data tables contain buttons on the right side, so if the buttons are frozen it would be more helpful.
HTML:
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
<div class="row">
<div class="col-md-12">
<div class="widget widget-table action-table" style="overflow:auto">
<!-- /widget-header -->
<div class="widget-content table-container" ng-controller="getTalentController">
<table ng-table="talentsList" show-filter="true" class="table table-striped table-bordered" style="font-size: smaller;text-align:center">
<tr ng-repeat="talent in data">
<td data-title="'#'" style="width:5px">{{ $index+1 }}</td>
<td data-title="'Employee ID'" sortable="'employeeNo'" filter="{ 'employeeNo': 'text' }" style="width:50px">
{{talent.employeeNo}}
</td>
<td data-title="'Name'" sortable="'fullName'" filter="{ 'fullName': 'text' }">
{{talent.fullName}}
</td>
<td data-title="'From'" sortable="'inDate'" filter="{ 'inDate': 'text' }">
{{talent.inDate}}
</td>
<td data-title="'Till'" sortable="'outTill'" filter="{ 'outTill': 'text' }">
{{talent.outTill}}
</td>
<td data-title="'Account'" sortable="'account'" filter="{ 'account': 'text' }">
{{talent.account}}
</td>
<td data-title="'State'" sortable="'state'" filter="{ 'state': 'text' }" ng-class="{greenStyle : talent.state == 'Available', blueStyle : talent.state == 'Billed', redStyle: talent.state == 'Blocked'}">
<div style="border:solid">{{talent.state}}</div>
</td>
<td data-title="'Remarks'" ng-click="showRemarks[$index]=!showRemarks[$index]" style="width:70px">
<span ng-hide="showRemarks[$index]" class="ellipses" style="width:inherit">{{talent.remark}} </span>
<span ng-show="showRemarks[$index]"> {{talent.remark}} </span>
</td>
<td data-title="'Resume'">
<a ng-click="downloadResume(talent.id)" class="btn btn-default" data-placement="top" data-toggle="tooltip" data-original-title="resume"><svg class="glyph translucent floppy-disk"><use xlink:href="#translucent-floppy-disk"></use></svg></a>
</td>
<td data-title="'Reserve'">
<a ui-sref="reservation.edit({id: talent.id})" class="btn btn-default" data-placement="top" data-toggle="tooltip" data-original-title="save"><svg class='glyph stroked hand-cursor'><use xlink:href='#stroked-hand-cursor' /></svg></a>
</td>
</tr>
</table>
</div>
<!-- /widget-content -->
</div>
<!-- /widget -->
</div>
<!-- /span12 -->
</div>
<!-- /row -->
</div>
I would like to freeze the columns on the right side carrying title 'State','Remarks','Resume',and 'Reserve'.
How can I achieve this. I guess the controller code wont be required for this problem. Currently I am creating scroll bar for the table by applying style="overflow:auto" for the outer div.
CSS : https://hastebin.com/wibahuyoxa.cs

Modal content grows but the container size stays the same

I am displaying my modal with angularjs and here is the template:
<div class="modal-lg" modal="showModal" close="cancel()">
<div class="modal-header">
<h4>Cihaz Listesi - {{deviceCount}}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12 table-responsive">
<table st-table="devices" st-safe-src="displayedDevices" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>IMEI-1</th>
<th>IMEI-2</th>
<th>MSISDN</th>
<th>Yeni IMEI-1</th>
<th>Yeni IMEI-2</th>
<th>Durum</th>
</tr>
</thead>
<tbody>
<tr data-ng-repeat="device in devices" ng-click="selectRow(device.ItsRepairImeiListId)" st-select-row="device" st-select-mode="multi">
<td>{{device.Imei1}}</td>
<td>{{device.Imei2}}</td>
<td>{{device.Msisdn}}</td>
<td>{{device.NewImei1}}</td>
<td>{{device.NewImei2}}</td>
<td>{{device.Status.StatusDescription}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center" st-pagination="" st-items-by-page="10" colspan="7"></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-show="selectedRows.length > 0" class="btn btn-success" ng-click="activateSelected()">Aktif Et</button>
<button class="btn btn-default" ng-click="cancel()">Kapat</button>
</div>
</div>
class="modal-lg" is supposed to make the modal larger but here is what it looks like after using it:
What should I do to make both the content the container grow together ?
Türkmüsün :D table a width 100% ata telefondayım net olarak bakamıyorum şu an sonra döneceğim sana
.tabloSinifim {
Width:100%;}
Attribute olarakta atayabilirsin.

Resources