right alignment of the content - html

When user click on any of the option(showOSpackage1,showOSPackage2), i want the content to be displayed on the right hand side. Right now when user click on showOSPackage1, the content is displayed on right side and even occupied the area on left side(table is displayed). Any inputs how can i make the content only visible on right side when user click on an option.
Please find the demo http://plnkr.co/edit/npfC9EiLtBMQCDs4M2I9?p=preview
sample code:
<div ng-controller="MainCtrl">
<div class="row">
<div class="vertical-menu;col-sm-3" style="width:20%;float:left;">
<a ng-click="toggle='ShowOsPackage1'" ng-class="{ 'active' : toggle === 'ShowOsPackage1' }">
showOsPackage1
</a>
<a ng-click="toggle='ShowOsPackage2'" ng-class="{ 'active' : toggle === 'ShowOsPackage2' }">
showOsPackage2
</a>
</div>
<div class="" ng-show="toggle === 'ShowOsPackage3'">
<h1>ShowOsPackage3</h1>
</div>
<div class="" ng-show="toggle === 'ShowOsPackage2'">
<h1>ShowOsPackage2</h1>
</div>
<div class="" ng-show="toggle === 'ShowOsPackage1'">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-primary">
<div>
<h2 style="text-align: center;">Table shown here</h2>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xs-1"> </div>
<div class="col-xs-8" style="width:80%;background: none;height: 660px;">
<table class="table table-scroll table-striped">
<thead>
<tr style="background-color: #cdd0d6;">
<th style="width:25%;white-space: nowrap;text-align: center;">Header1</th>
<th style="width:10%;white-space: nowrap;text-align: center;">Header1</th>
<th style="width:10%;white-space: nowrap;text-align: center;">Header3 </th>
</tr>
</thead>
<tbody style="width:95%;height:200px;overflow:auto;display:block;">
<tr>
<td style="width:25%;text-align: center;">
HEADER1 CONTENT
<td style="width:10%;text-align: center; ">
header2 content
</td>
<td style="width:10%;text-align: center;">
header3 content
</td>
</tr>
<tr>
<td style="width:25%;text-align: center;">
HEADER1 CONTENT
<td style="width:10%;text-align: center; ">
header2 content
</td>

try adding this css :
.options{
width: 20%;
float: left;
margin-top: 30px;
}
.colcontent {
width: 80%;
float: right;
}
Plus is your plnkr bootstrap isn't applied.

Related

How to remove gap between two td

How to remove gap between two td ? I have tried some below solutions
from the Internet but none of them work. Attached the screenshot for
reference too. It will give clear idea of problem. The gap between two TD is very wide. How to reduce this Gap.
class="align-middle"
CELLSPACING=0
row-gap: 0;
class="views-field views-field-region views-align-center"
<app-header></app-header>
<section class="container">
<div class="row" style="background-color: white;">
<div class="col-xs-12 col-sm-8 col-md-4" >
<form action="/update/pricelist" method="POST" id="upload-file" enctype="multipart/form-data">
<h3>Import Pricelist</h3>
<hr>
<div class="wrapper-messages">
</div>
<br>
<input type="file" name="price_list" id="edit_price_list" (change)="ReadExcel($event)">
<div class="error-msg"></div>
<hr>
<div class="views-exposed-widget views-submit-button">
<button type="submit" class="btn btn-info form-submit icon-before submit-pricelist">
<span class="icon glyphicon glyphicon-ok" aria-hidden="true"></span>
Import
</button>
</div>
<br>
</form>
</div>
</div>
</section>
<!-- Table for excel -->
<div class="main-container container-fluid">
<div class="row">
<section id="block-views-exp-land-page" class="block block-views clearfix">
<form autocomplete="off" action="" method="post" id="views-exposed-form-land-page" accept-charset="UTF-8">
<div>
<section id="block-system-main" class="block block-system clearfix">
<div
class="view view-land view-id-land view-display-id-page table-checkbox-all view-dom-id-8d32f83bab6c36c396b926a7c7c35f7f">
</div>
<div class="view-content">
<div class="table-responsive" class="col-10" class="row align-items-center" class="col-md-12">
<table class="views-table cols-16 table table-hover table-0 table-0 table-0 neilsoft-region-table">
<thead class="neilsoft-region-table-head">
<tr>
<th class="views-field views-field-region views-align-center">
Autodesk Material Description
</th>
<th class="views-field views-field-php-4 views-align-center">
Autodesk SAP Material Description
</th>
<th class="views-field views-field-php-2 views-align-center">
Product Coming From
</th>
<th class="views-field views-field-php-2 views-align-center">
Media
</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="view-content">
<div class="table-responsive" class="col-10" class="row align-items-center" class="col-md-12">
<table class="views-table cols-16 table table-hover table-0 table-0 table-0 neilsoft-region-table">
<thead class="neilsoft-region-table-head">
<tr *ngFor="let pricedata of ExcelData" class="align-middle">
<td>
{{pricedata.Autodesk_Material_Description}}
</td>
<td>
{{pricedata.Autodesk_SAP_Material_Description}}
</td>
<td>
{{pricedata.Product_Coming_From}}
</td>
<td>
{{pricedata.Media}}
</td>
</tr>
</thead>
</table>
</div>
</div>
</section>
</div>
</form>
</section>
</div>
</div>
<app-footer></app-footer>[enter image description here][1]
I suggest you looking for html table colspan (https://html.com/tables/rowspan-colspan/). With colspan you can merge two td cells. Take a look in the example below:
td {
width: 30px;
}
<table border="1">
<tr>
<td colspan="2">Merged</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
Perhaps border-collapse: collapse; is what you’re missing?
td {
background: red;
color: white;
padding: 0.5em;
}
.t1 {
margin-top: 2em;
border-collapse: collapse;
}
<table>
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
</table>
<table class="t1">
<tr><td>1</td><td>2</td><td>3</td></tr>
<tr><td>4</td><td>5</td><td>6</td></tr>
</table>

Bootstrap 4 eliminate white space from title

I would like to remove the white space between Table Title and Sub Titles.
Also Sub Title "Sub1" together with the icon should be left-aligned within the cell
<div class="mdc-layout-grid__cell stretch-card mdc-layout-grid__cell--span-3">
<div class="mdc-card p-0">
<h6 class="card-title">Table title</h6>
<div class="table-responsive">
<table class="table">
<thead bgcolor="#aed581">
<tr>
<th>
<span class="text-left">Sub1</span>
<span class="material-icons refresh-icon">refresh</span>
</th>
<th>Sub2</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-left">A</td>
<td>18.5%</td>
</tr>
<tr>
<td class="text-left">B</td>
<td>16.3%</td>
</tr>
<tr>
<td class="text-left">V</td>
<td>15.5%</td>
</tr>
</table>
</div>
</div>
</div>
You need do with some css for remove that space
apply this css into ur css file margin-bottom: 0; will remove space from table-responsive and card title
.card-title{
background-color: #aed581;
padding: 15px;
font-weight: bold;
margin-bottom: 0;
}
.fa-repeat{
color: lightgray;
cursor: pointer;
}
and for icon i used font-awesome icon here is the CDN link
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
Here is the HTML
<div class="mdc-layout-grid__cell stretch-card mdc-layout-grid__cell--span-3">
<div class="mdc-card p-0">
<h6 class="card-title">Table title</h6>
<div class="table-responsive">
<table class="table">
<thead bgcolor="#aed581">
<tr>
<th>
<i class="fa fa-repeat"></i>
Sub1
<!-- <span class="material-icons refresh-icon">refresh</span> -->
</th>
<th>Sub2</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-left">A</td>
<td>18.5%</td>
</tr>
<tr>
<td>B</td>
<td>16.3%</td>
</tr>
<tr>
<td>V</td>
<td>15.5%</td>
</tr>
</table>
</div>
</div>
</div>
You can edit or preview code here

How to right align the button in html

Actually I am trying to append the content from js to html table.And also with it I am trying to add a button below the table to the extreme right of the page.But I am not able to align it.Please guide where am I going wrong.
HTML Code is:
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%
}
td,
th {
border: 1px solid #dddddd;
text-align: left;
padding: 20px;
}
#table {
margin-left: -900px;
}
<!DOCTYPE html>
<html>
<head>
<body>
<div id="table" style="display:none">
<div class="container text-center">
<div class="row">
<div class="col-sm-4"></div>
<!--If I remove this line the table only will not be displayed-->
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">Reportees List</div>
<table id="employee_table" class="table table-hover" cellspacing="0" width="100%">
<tr>
<th>Number</th>
<th>Name</th>
<th>UserId</th>
<th>Count</th>
</tr>
</table>
</div>
</div>
<div id="jiratable" style="display:none">
<div class="container text-center">
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<div class="panel panel-primary" style="width: 240%;">
<div class="panel-heading">JIRA - List</div>
<table class="table table-hover">
<table id="Jira_table" class="table table-hover" cellspacing="0" style="width:240%;table-layout:fixed">
<thead>
<tr>
<th width="80">Number</th>
<th>JiraNumber</th>
<th>JiraStatus</th>
<th>EmailId</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<div class="container">
<div style="text-align:right; width:100%; padding:0;">
<button id="sendMail" class="btn btn-primary btn-lg pull-right" onclick="sendMail()">SendMail</button>
</div>
</div>
</body>
</html>
I don't know where I am going wrong.
Expected output is:
Number id name count Number JiraNumber Jirastatus EmailId
1 AG RAJ 0 1 TR-150 RS-Release **#gmail
2 TG Ram 3 1 TR-152 RS1-Release **#gmail
1 TR-153 RS2-Release **#gmail
SendMail Cancel
So I want the SendMail and cancel button to right.But the output is:
Number id name count Number JiraNumber Jirastatus EmailId
1 AG RAJ 0 1 TR-150 RS-Release **#gmail
2 TG Ram 3 1 TR-152 RS1-Release **#gmail
1 TR-153 RS2-Release **#gmail
SendMail Cancel
This is a list of your problems.
You're missing alot of closing tags
Your table won't display because you have style="display:none" which mean it won't display.
info for display
In the code you have lots of missing aligns which makes the table weird.
class="btn btn-primary btn-lg pull-right" this class is already right align
To align the tables side by side, either make a parent table for the data table or **within the CSS, you can set the division positioning **(which mean more work/more code you need to have)
Im suggesting you use this code.
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 50px;
/*edit this as you want*/
}
td,
th {
border: 1px solid #dddddd;
text-align: left;
padding: 20px;
}
/* to clear the border */
.noborder {
border: none;
}
<!DOCTYPE html>
<html>
<body>
<table>
<td>
<div id="table" style="display:block">
<div class="container text-center">
<div class="row">
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">Reportees List</div>
<table id="employee_table" class="table table-hover" cellspacing="0" width="100%">
<tr>
<th>Number</th>
<th>Name</th>
<th>UserId</th>
<th>Count</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</td>
<td>
<div id="jiratable" style="display:block">
<div class="container text-center">
<div class="row">
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">JIRA - List</div>
<table id="Jira_table" class="table table-hover" cellspacing="0">
<tr>
<th>Number</th>
<th>JiraNumber</th>
<th>JiraStatus</th>
<th>EmailId</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</td>
<tr>
<td class="noborder"></td>
<td class="noborder">
<div class="container">
<div style="text-align:right; width:100%; padding:0;">
<button id="sendMail" onclick="sendMail()">SendMail</button>
</div>
</div>
</td>
</table>
</body>
</html>
Summary
The important thing you need to change are the closing of tags. This might effect your output.
Refer:
About closing tag
*You are not properly closed end div tags properly
*remove style hidden
*merge two tables and remove a border
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
border: none !important;
}
td,
th {
text-align: left;
padding: 20px;
}
<!DOCTYPE html>
<html>
<body>
<div id="table" style="display:block">
<div class="container text-center">
<div class="row">
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">Reportees List</div>
<table id="employee_table" class="table table-hover" cellspacing="0" width="100%" cellspacing="0">
<tr>
<th>Number</th>
<th>Name</th>
<th>UserId</th>
<th>Count</th>
<th>Number</th>
<th>JiraNumber</th>
<th>JiraStatus</th>
<th>EmailId</th>
</tr>
<tr>
<td>1</td>
<td> Ag</td>
<td>1</td>
<td>Raj </td>
<td>0</td>
<td>1 </td>
<td>TR0-150</td>
<td>GMAIL </td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div style="text-align:right; width:100%; padding:0;">
<button id="sendMail" class="btn btn-primary btn-lg pull-right" style="color: white; background-color: blue;padding:5px" onclick="sendMail()">SendMail</button>
</div>
</div>
</body>
</html>

Height of all elements the same in Firefox but not Chrome

I would like to have all my boxes the same height
I used the CSS display: flex and it works fine for the first block but not his child
It works fine on Firefox but not on chrome
I found the row-eq-height class on getbootstrap but it isn't better on chrome
my page on chrome
my page on firefox
I have a div class row-eq-height then a col-md-4 and a panel
The panel height don't want to change
the code :
<div class="row-eq-height">
<div class="col-md-4">
<div class="panel panel-default no-padding server-box">
<!-- Default panel contents -->
<div class="panel-heading title-box">Regrowth</div>
<!-- Table -->
<table class="table server-table">
<tbody>
<tr>
<th>Adresse IP</th>
<td>#</td>
</tr>
<tr>
<th>Joueurs en ligne</th>
<td class="progress-bar-wrap">
<div>
<span style="width: 0%;"></span>
<span class="progress-bar-content">0
/50</span>
</div>
</td>
</tr>
<tr>
<th>Statut</th>
<td><img src="#" alt="status"></td>
</tr>
<tr>
<th>Ms/Tps</th>
<td class="good-tps">2.8 ms / 20 tps</td>
</tr>
<tr class="heads-tr">
<td class="heads-td">
<div class="heads">
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default no-padding server-box">
<!-- Default panel contents -->
<div class="panel-heading title-box">InfinityHard</div>
<!-- Table -->
<table class="table server-table">
<tbody>
<tr>
<th>Adresse IP</th>
<td>#</td>
</tr>
<tr>
<th>Joueurs en ligne</th>
<td class="progress-bar-wrap">
<div>
<span style="width: 6%;"></span>
<span class="progress-bar-content">3
/50</span>
</div>
</td>
</tr>
<tr>
<th>Statut</th>
<td><img src="#" alt="status"></td>
</tr>
<tr>
<th>Ms/Tps</th>
<td class="#">7.1 ms / 20 tps</td>
</tr>
<tr class="heads-tr">
<td class="heads-td">
<div class="heads">
<img src="#" alt="Melkutus" data-toggle="tooltip"
data-trigger="hover" data-placement="bottom" title="Melkutus">
<img src="#"
data-toggle="tooltip" data-trigger="hover" data-placement="bottom"
title="FortunateTrollz">
<img src="#" alt="Asseo" data-toggle="tooltip"
data-trigger="hover" data-placement="bottom" title="Asseo">
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
and the css
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.panel-container .server-box {
height: 100%;
}
thanks to people who will understand and answer me !

replace table layout with DIVs

I am new to DIV tags with CSS layout. I have the following layout in Tables and trying to replace with DIVs. We are using DIV tags in our application. So I do not want interfere with existing layout. I appreciate any input.
<table style="width:100%;" border="1">
<tr>
<td style="width: 80%; " colspan="4"></td><td rowspan="3"></td>
</tr>
<tr>
<td style="width: 20%; "></td><td style="width: 20%; "></td><td style="width: 20%; "></td><td style="width: 20%;"></td>
</tr>
<tr>
<td style="width: 40%; " colspan="2"></td><td style="width: 40%; " colspan="2"></td>
</tr>
</table>
As someone already mentioned you should probably use some framework, such as Bootstrap for example: http://getbootstrap.com/css/#grid
However here is a small fiddle example of "table" only with "DIV tags": https://jsfiddle.net/Munja/q3f21Lnk/
<div class="table">
<div class="first">
<div class="one"></div>
<div class="one">
<div class="one-fourth"></div>
<div class="one-fourth"></div>
<div class="one-fourth"></div>
<div class="one-fourth"></div>
</div>
<div class="one">
<div class="one-half"></div>
<div class="one-half"></div>
</div>
</div>
<div class="second"></div>
</div>