How to make buttons stay aligned in table when resizing - html

I have a table that has buttons in it. It looks great but when I adjust the browser for resizing some of the content moves, causing the buttons to not be lined up properly. Any thoughts on this would be great. The table needs to look the way it does, with the thick borders on the outside and between each row and column. It may be a simple fix, but for some reason it is stumping me. I've tried using bootstrap and putting each one into it's own row .
table {
border-collapse: separate;
border-spacing: 15px 15px;
}
td {
background-color:white;
text-align:center;
}
img {
margin:0px auto;
display:block
}
p {
padding-top:5px;
}s
h3 {
margin-top:10px;
letter-spacing:2px;
font-weight: lighter;
}
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12">
<h1>Finding an Internship</h1>
<hr />
</div>
<div class="col-xs-12 col-sm-12">
<p style="color:#036CB6; font-size:18px;">Students are responsible for finding their own internships but there are many resources available.</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12">
<div class="table-responsive" style="background-color: #F1F2F2">
<table class="table">
<tr>
<td>
<img src="Images/advising/internships/InternshipCoordinators.png"" class="img-responsive" alt="Internship Coordinators">
<h3>Internship<br/>Coordinators</h3>
<p>Visit with your Department<br/>Internship Coordinator to ensure<br/>you understand all your<br/>department's guidelines.</p>
<a style="background-color:#0668B3;" href="x116191.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/ResumeAndCoverLetterReviews.png" class="img-responsive" alt="Resume and CoverLetter Reviews">
<h3>RESUME AND COVER<br/>LETTER REVIEWS</h3>
<p>Have your resume and cover letter<br/>reviewed by meeting with atrained<br/>peer mentor.<br/><br/></p>
<a style="background-color:#0668B3;" href="http://www.byui.edu/iplan/beta/tutorials/advising-schedule-an-appointment" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/InternshipApprovalProcess.png" class="img-responsive" alt="Internship Approval Process">
<h3>INTERNSHIP<br />APPROVAL PROCESS</h3>
<p>Once you have found an internship,<br />follow the internship approval<br /> process.<br/><br/></p>
<a style="background-color:#0668B3;" href="x116857.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
</tr>
<tr>
<td>
<img src="Images/advising/internships/CareerNavigator.png" class="img-responsive" alt="Career Navigator">
<h3>CAREER NAVIGATOR</h3>
<p><br/>Read past issues of Perspective,<br/>watch instructional videos, find past<br/>workshops and more.<br/><br/></p>
<a style="background-color:#0668B3;" href="https://byui-csm.symplicity.com/" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/AlumniOffice.png" class="img-responsive" alt="Alumni Office">
<h3>ALUMNI OFFICE</h3>
<p><br/>Apply to travel to a conference,<br/>come get a lunch at a Brown Bag<br/>Discussion, attend workshops and<br/>more.</p>
<a style="background-color:#0668B3;" href="http://www.byui.edu/alumni" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/Linkedin.png" class="img-responsive" alt="Linkedin">
<h3>LINKEDIN</h3>
<p><br/>Get the latest information and read<br/>faculty news articles in our<br/>Instructional Development<br/>newsroom.</p>
<a style="background-color:#0668B3;" href="https://www.linkedin.com/" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
</tr>
<tr>
<td>
<img src="Images/advising/internships/cnc.png" class="img-responsive" alt="Career Networking Center">
<h3>CAREER NETORKING<br/>CENTER</h3>
<p>Offers the networking crash course,<br/>walk-in resume help, and general<br/>career planning.<br/><br/></p>
<a style="background-color:#0668B3;" href="x116064.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/InternshipServiceMissionaries.png" class="img-responsive" alt="InternshipServiceMissionaries">
<h3>INTERNSHIP SERVICE<br/>MISSIONARIES</h3>
<p>Visit with your Department<br/>Internship Service Missionaries to<br/>seek out opportunites.<br/><br/></p>
<a style="background-color:#0668B3;" href="x116158.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/11-15BYUIInternships.png" class="img-responsive" alt="11-15 BYUI Internships">
<h3>BYU-IDAHO<br/>INTERNSHIPS: 2011-2015</h3>
<p>Search past internships completed<br/>by BYU-Idaho students for ideas of<br/>companies.<br/><br/></p>
<a style="background-color:#0668B3;" href="http://www.byui.edu/Documents/advising/internships/BYUI%20INTERNSHIPS%202011%20-%202015(1).xlsx" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
</tr>
</table>
</b>
</div>
</div>
</div>

To ensure the button remains consistent, you have to wrap the h3 and p elements inside a container that has fixed height, that way when you resize the browser the height remains the same.
HTML
<td>
<img>
<div class="fixed-height">
<h3>title</h3>
<p>content</p>
</div>
<a>button</a>
</td>
CSS
.fixed-height {
height: 300px;
}

Here you go :)
table {
border-collapse: separate;
border-spacing: 15px 15px;
}
td {
background-color:white;
text-align:center;
position: relative;
}
td a {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
img {
margin:0px auto;
display:block
}
p {
padding-top:5px;
}s
h3 {
margin-top:10px;
letter-spacing:2px;
font-weight: lighter;
}
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12">
<h1>Finding an Internship</h1>
<hr />
</div>
<div class="col-xs-12 col-sm-12">
<p style="color:#036CB6; font-size:18px;">Students are responsible for finding their own internships but there are many resources available.</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12">
<div class="table-responsive" style="background-color: #F1F2F2">
<table class="table">
<tr>
<td>
<img src="Images/advising/internships/InternshipCoordinators.png"" class="img-responsive" alt="Internship Coordinators">
<h3>Internship<br/>Coordinators</h3>
<p>Visit with your Department<br/>Internship Coordinator to ensure<br/>you understand all your<br/>department's guidelines.</p>
<a style="background-color:#0668B3;" href="x116191.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/ResumeAndCoverLetterReviews.png" class="img-responsive" alt="Resume and CoverLetter Reviews">
<h3>RESUME AND COVER<br/>LETTER REVIEWS</h3>
<p>Have your resume and cover letter<br/>reviewed by meeting with atrained<br/>peer mentor.<br/><br/></p>
<a style="background-color:#0668B3;" href="http://www.byui.edu/iplan/beta/tutorials/advising-schedule-an-appointment" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/InternshipApprovalProcess.png" class="img-responsive" alt="Internship Approval Process">
<h3>INTERNSHIP<br />APPROVAL PROCESS</h3>
<p>Once you have found an internship,<br />follow the internship approval<br /> process.<br/><br/></p>
<a style="background-color:#0668B3;" href="x116857.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
</tr>
<tr>
<td>
<img src="Images/advising/internships/CareerNavigator.png" class="img-responsive" alt="Career Navigator">
<h3>CAREER NAVIGATOR</h3>
<p><br/>Read past issues of Perspective,<br/>watch instructional videos, find past<br/>workshops and more.<br/><br/></p>
<a style="background-color:#0668B3;" href="https://byui-csm.symplicity.com/" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/AlumniOffice.png" class="img-responsive" alt="Alumni Office">
<h3>ALUMNI OFFICE</h3>
<p><br/>Apply to travel to a conference,<br/>come get a lunch at a Brown Bag<br/>Discussion, attend workshops and<br/>more.</p>
<a style="background-color:#0668B3;" href="http://www.byui.edu/alumni" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/Linkedin.png" class="img-responsive" alt="Linkedin">
<h3>LINKEDIN</h3>
<p><br/>Get the latest information and read<br/>faculty news articles in our<br/>Instructional Development<br/>newsroom.</p>
<a style="background-color:#0668B3;" href="https://www.linkedin.com/" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
</tr>
<tr>
<td>
<img src="Images/advising/internships/cnc.png" class="img-responsive" alt="Career Networking Center">
<h3>CAREER NETORKING<br/>CENTER</h3>
<p>Offers the networking crash course,<br/>walk-in resume help, and general<br/>career planning.<br/><br/></p>
<a style="background-color:#0668B3;" href="x116064.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/InternshipServiceMissionaries.png" class="img-responsive" alt="InternshipServiceMissionaries">
<h3>INTERNSHIP SERVICE<br/>MISSIONARIES</h3>
<p>Visit with your Department<br/>Internship Service Missionaries to<br/>seek out opportunites.<br/><br/></p>
<a style="background-color:#0668B3;" href="x116158.xml" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
<td>
<img src="Images/advising/internships/11-15BYUIInternships.png" class="img-responsive" alt="11-15 BYUI Internships">
<h3>BYU-IDAHO<br/>INTERNSHIPS: 2011-2015</h3>
<p>Search past internships completed<br/>by BYU-Idaho students for ideas of<br/>companies.<br/><br/></p>
<a style="background-color:#0668B3;" href="http://www.byui.edu/Documents/advising/internships/BYUI%20INTERNSHIPS%202011%20-%202015(1).xlsx" class="btn btn-primary" role="button">LEARN MORE</a>
</td>
</tr>
</table>
</b>
</div>
</div>
</div>

Related

how to set the html bootstrap buttons responsive in mobile

I am new here so apologies if anything wrong I mention.
I want to make my bootstrap buttons mobile responsive. but, I am new to CSS. i want to display my buttons and text in middle of screen for small devices after video.so please tell me how to do it.
Here is my HTML code:
<div class="row" style="margin-top: 5%">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 ">
<p style="float: right; color: black;">I'm Ready to get my risk free <br /> membership today! <br /> (Limited Time and Quantities) </p>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 ">
<a href="#">
<button class="btn btn-theme btn-sm" style="background: white;color: #404040">
My Email Address
</button> </a>
<a href="#">
<button class="btn btn-theme btn-sm" style="background: #404040; border-radius: 10px; color: white">
Keep me on your email list
</button> </a>
<a href="#">
<button class="btn btn-theme btn-sm" style="background: yellow; border-radius: 10px; float: right; color: black">
Get My Risk <br /> Free Membership today
</button> </a>
</div>
</div>
Here is the code. Hope it will Help you. I have added some of classes into p and a tag. Even i put css for mobile view. If any changes please let me know.
#media screen and (max-width: 767px) {
.email-wrap {
display: block;
margin-bottom: 20px;
text-align: center;
}
.text-wrap {
text-align: center;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="main-wrapper">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<p class="text-wrap">I'm Ready to get my risk free <br /> membership today! <br />
(Limited Time and Quantities) </p>
</div>
</div>
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<a href="#" class="email-wrap"><button class="btn btn-theme btn-sm" style="background: white;color: #404040">
My Email Address
</button> </a>
<a href="#" class="email-wrap"><button class="btn btn-theme btn-sm" style="background: #404040; border-radius: 10px; color: white">
Keep me on your email list
</button> </a>
<a href="#" class="email-wrap"><button class="btn btn-theme btn-sm" style="background: yellow; border-radius: 10px;color: black">
Get My Risk <br /> Free Membership today
</button> </a>
</div>
You can use media query for it or bootstrap 4 classes.
here is link for bootstrap class:
https://getbootstrap.com/docs/4.0/utilities/display/
#media (max-width: 575px){
p{
text-align: center;
float: unset !important;
}
a {
display: flex;
justify-content: center;
margin-bottom: 15px;
}
}
<div class="row" style="margin-top: 5%">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 ">
<p style="float: right; color: black;">I'm Ready to get my risk free <br /> membership today! <br />
(Limited Time and Quantities) </p>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12">
<a href="#"><button class="btn btn-theme btn-sm" style="background: white;color: #404040">
My Email Address
</button> </a>
<a href="#"><button class="btn btn-theme btn-sm" style="background: #404040; border-radius: 10px; color: white">
Keep me on your email list
</button> </a>
<a href="#"><button class="btn btn-theme btn-sm" style="background: yellow; border-radius: 10px; float: right; color: black">
Get My Risk <br /> Free Membership today
</button> </a>
</div>
</div>

Display card and table inline

I am trying to create webpage from twitter bootstrap.I used card and table properties there.Problem im getting here is my table is displaying below card.I tried adding float-right float-left classes but that is not working.i want card to float left and table on right side on large screens and both responsive on small screen.Any idea how can i do it?
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4">
<!--Card-->
<div class="card mb-4 box-shadow">
<!--Image-->
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=55595c&fg=eceeef&text=Thumbnail" alt="Item_name" style="width: 100%; display: block;" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22348%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20348%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_161ad3c12bc%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A17pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_161ad3c12bc%22%3E%3Crect%20width%3D%22348%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22116.5%22%20y%3D%22120.3%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
<!--Below Image-->
<div class="card-body">
<!--Item-Name-->
<p class="card-text item-header"><i class="fa fa-hashtag"></i>1 Item 1</p>
<!--Affiliate Section-->
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group mb-2 affilaite-group">
<button type="button" class="btn btn-lg btn-outline-secondary amazon" a href="" style="text-decoration: none;"><i class="fa fa-amazon" style="color: #0E0B16;"></i> Amazon</a></button>
<button type="button" class="btn btn-lg btn-outline-secondary amazedon-2" a href="" style="text-decoration: none;"> 400</button>
</div>
</div>
<div class="btn-group affilaite-group">
<button type="button" class="btn btn-lg btn-outline-secondary ebay" a href="" style="text-decoration: none;"><img class="ebayed" src="flipkart.svg" alt="" style="color:#0E0B16;height: 18px;"> ebay</button>
<button type="button" class="btn btn-lg btn-outline-secondary flab" a href="" style="text-decoration: none;">500</button>
</div>
</div>
</div> <!--Specification Table-->
<table class="table table-responsive table-striped">
<tbody>
<tr>
<th>OS</th>
<td>Android Marshmallow 6.0</td>
</tr>
<tr>
<th>STORAGE</th>
<td>Internal: 32 / 64 GB<br>
Expandable: Yes (128 GB)</td>
</tr>
<tr>
<th>RAM</th>
<td>2/3/4 GB</td>
</tr>
<tr>
<th>Battery & SIM</th>
<td>Dual Sim (1 nano & 1 micro) 4GLTE<br>
4100mAh Non-Removable</td>
</tr>
<tr>
<th>Camera</th>
<td><span class="td-bold" style="font-weight: 700;">Rear:</span> 13 MP (CMOS Camera,f2.0 Aperature)<br><span class="td-bold" style="font-weight: 700;">Front:</span> 5 MP (1080p Full HD Video Recording)
</td>
</tr>
<tr>
<th>Processor</th>
<td>Qualcomm Snapdragon 625 Octa-Core<br>
Adreno 506</td>
</tr>
<tr>
<th>Dispaly</th>
<td>1920 x 1080 5.5 inch (401ppi) IPS LCD</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.3.1.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>
Edited your html code .you have put both card and table col-md-4.
I have changed it
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" >
<div class="container">
<div class="row">
<div class="col-md-4">
<!--Card-->
<div class="card mb-4 box-shadow">
<!--Image-->
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=55595c&fg=eceeef&text=Thumbnail" alt="Item_name" style="width: 100%; display: block;" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22348%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20348%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_161ad3c12bc%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A17pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_161ad3c12bc%22%3E%3Crect%20width%3D%22348%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22116.5%22%20y%3D%22120.3%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
<!--Below Image-->
<div class="card-body">
<!--Item-Name-->
<p class="card-text item-header"><i class="fa fa-hashtag"></i>1 Item 1</p>
<!--Affiliate Section-->
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group mb-2 affilaite-group">
<button type="button" class="btn btn-lg btn-outline-secondary amazon" a href="" style="text-decoration: none;"><i class="fa fa-amazon" style="color: #0E0B16;"></i> Amazon</a></button>
<button type="button" class="btn btn-lg btn-outline-secondary amazedon-2" a href="" style="text-decoration: none;"> 400</button>
</div>
</div>
<div class="btn-group affilaite-group">
<button type="button" class="btn btn-lg btn-outline-secondary ebay" a href="" style="text-decoration: none;"><img class="ebayed" src="flipkart.svg" alt="" style="color:#0E0B16;height: 18px;"> ebay</button>
<button type="button" class="btn btn-lg btn-outline-secondary flab" a href="" style="text-decoration: none;">500</button>
</div>
</div>
</div> <!--Specification Table-->
</div>
<div class="col-md-4">
<table class="table table-responsive table-striped">
<tbody>
<tr>
<th>OS</th>
<td>Android Marshmallow 6.0</td>
</tr>
<tr>
<th>STORAGE</th>
<td>Internal: 32 / 64 GB<br>
Expandable: Yes (128 GB)</td>
</tr>
<tr>
<th>RAM</th>
<td>2/3/4 GB</td>
</tr>
<tr>
<th>Battery & SIM</th>
<td>Dual Sim (1 nano & 1 micro) 4GLTE<br>
4100mAh Non-Removable</td>
</tr>
<tr>
<th>Camera</th>
<td><span class="td-bold" style="font-weight: 700;">Rear:</span> 13 MP (CMOS Camera,f2.0 Aperature)<br><span class="td-bold" style="font-weight: 700;">Front:</span> 5 MP (1080p Full HD Video Recording)
</td>
</tr>
<tr>
<th>Processor</th>
<td>Qualcomm Snapdragon 625 Octa-Core<br>
Adreno 506</td>
</tr>
<tr>
<th>Dispaly</th>
<td>1920 x 1080 5.5 inch (401ppi) IPS LCD</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Please use this code it's works for me, this fully responsive :
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<!--Card-->
<div class="card mb-4 box-shadow">
<!--Image-->
<img class="card-img-top" data-src="holder.js/100px225?theme=thumb&bg=55595c&fg=eceeef&text=Thumbnail" alt="Item_name"
style="width: 100%; display: block;" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22348%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20348%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_161ad3c12bc%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A17pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_161ad3c12bc%22%3E%3Crect%20width%3D%22348%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22116.5%22%20y%3D%22120.3%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E"
data-holder-rendered="true">
<!--Below Image-->
<div class="card-body">
<!--Item-Name-->
<p class="card-text item-header">
<i class="fa fa-hashtag"></i>1 Item 1</p>
<!--Affiliate Section-->
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group mb-2 affilaite-group">
<button type="button" class="btn btn-lg btn-outline-secondary amazon">
<a href="" style="text-decoration: none;">
<i class="fa fa-amazon" style="color: #0E0B16;"></i>
Amazon</a>
</button>
<button type="button" class="btn btn-lg btn-outline-secondary amazedon-2" a href="" style="text-decoration: none;"> 400</button>
</div>
</div>
<div class="btn-group affilaite-group">
<button type="button" class="btn btn-lg btn-outline-secondary ebay" style="text-decoration: none;">
<img class="ebayed" src="flipkart.svg" alt="" style="color:#0E0B16;height: 18px;"> ebay </button>
<button type="button" class="btn btn-lg btn-outline-secondary flab">
500
</button>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<!--Specification Table-->
<table class="table table-responsive table-striped">
<tbody>
<tr>
<th>OS</th>
<td>Android Marshmallow 6.0</td>
</tr>
<tr>
<th>STORAGE</th>
<td>Internal: 32 / 64 GB
<br> Expandable: Yes (128 GB)</td>
</tr>
<tr>
<th>RAM</th>
<td>2/3/4 GB</td>
</tr>
<tr>
<th>Battery & SIM</th>
<td>Dual Sim (1 nano & 1 micro) 4GLTE
<br> 4100mAh Non-Removable</td>
</tr>
<tr>
<th>Camera</th>
<td>
<span class="td-bold" style="font-weight: 700;">Rear:</span> 13 MP (CMOS Camera,f2.0 Aperature)
<br>
<span class="td-bold" style="font-weight: 700;">Front:</span> 5 MP (1080p Full HD Video Recording)
</td>
</tr>
<tr>
<th>Processor</th>
<td>Qualcomm Snapdragon 625 Octa-Core
<br> Adreno 506</td>
</tr>
<tr>
<th>Dispaly</th>
<td>1920 x 1080 5.5 inch (401ppi) IPS LCD</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.3.1.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>

Toggle a bootstrap table to show and hide

I have the attached code. I'm using 2 tables here. The last cell of the first table has a link that should toggle the second table under it. Now if I use the bootstrap's "collapse" class(to hide the second table) and click on the link in the first table, the whole design gets messed up. If, on the other hand, I remove the collapsed class, the design stays intact. Any help would be appreciated.
<div id="market-golden-scroll" class="mCustomScrollbar" data-mcs-theme="rounded-dark">
<table class="table table-responsive table-hover">
<tr>
<td>
<div class="row">
<div class="col-sm-1">
<img alt="" class="img-profile-pic img-circle" src="images/profile-pic.fw.png">
</div>
<div class="col-sm-7 padd-top-5">
<a class="lnk-affiliates" href="#" target="_blank"> Fatima Zahra </a>
</div>
<div class="col-sm-4 text-right padd-top-5">
<button class="btn btn-success btn-sm"> Add Affiliate </button>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-sm-1">
<a href="#">
<svg viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" style="width:38px;height:38px;">
<defs>
<pattern id="img5" patternContentUnits="objectBoundingBox" width="100%" height="100%">
<image xlink:href="images/my-store.gif" preserveAspectRatio="none" width="1" height="1">
</pattern>
</defs>
<polygon points="50 1 92 25 92 75 50 99 8 75 8 25" fill="url(#img5)" style="stroke: #999DA3;">
</svg>
</a>
</div>
<div class="col-sm-7 padd-top-5">
<a class="lnk-affiliates" href="#" target="_blank">Steve Austin </a>
</div>
<div class="col-sm-4 text-right padd-top-5">
<button class="btn btn-success btn-sm"> View Profile</button>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-sm-1">
<img alt="" class="img-profile-pic img-circle" src="images/profile-pic.fw.png">
</div>
<div class="col-sm-7 padd-top-5">
<a class="lnk-affiliates" href="#" target="_blank"> Fatima Zahra </a>
</div>
<div class="col-sm-4 text-right padd-top-5">
<button class="btn btn-success btn-sm"> Add Affiliate </button>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-sm-1">
<a href="#">
<svg viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" style="width:38px;height:38px;">
<defs>
<pattern id="img4" patternContentUnits="objectBoundingBox" width="100%" height="100%">
<image xlink:href="images/my-store.gif" preserveAspectRatio="none" width="1" height="1">
</pattern>
</defs>
<polygon points="50 1 92 25 92 75 50 99 8 75 8 25" fill="url(#img4)" style="stroke: #999DA3;">
</svg>
</a>
</div>
<div class="col-sm-7 padd-top-5">
<a class="lnk-affiliates" href="#" target="_blank">Andalus </a>
</div>
<div class="col-sm-4 text-right padd-top-5">
<button class="btn btn-success btn-sm"> View Profile</button>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-sm-1">
<img alt="" class="img-profile-pic img-circle" src="images/profile-pic.fw.png">
</div>
<div class="col-sm-7 padd-top-5">
<a class="lnk-affiliates" href="#" target="_blank"> Fatima Zahra </a>
</div>
<div class="col-sm-4 text-right padd-top-5">
<button class="btn btn-success btn-sm"> Add Affiliate</button>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<!-- load more likers -->
<div class="col-sm-12 padd-top-5 text-right">
<a data-toggle="collapse" data-target="#tabLoadMoreLikers" class="lnk-affiliates" href="#">Load More </a>
</div>
</div>
</td>
</tr>
</table>
<table id="tabLoadMoreLikers" class="table table-responsive table-hover collapse">
<tr>
<td>
<div class="row">
<div class="col-sm-1">
<img alt="" class="img-profile-pic img-circle" src="images/profile-pic.fw.png">
</div>
<div class="col-sm-7 padd-top-5">
<a class="lnk-affiliates" href="#" target="_blank"> Fatima Zahra </a>
</div>
<div class="col-sm-4 text-right padd-top-5">
<button class="btn btn-success btn-sm"> Add Affiliate </button>
</div>
</div>
</td>
</tr>
</table>
</div><!-- market-golden scroll -->
Glad the design still intact
Your code are hard to read but the concept is clear - you want the link from 1st table to toggle hide/show of the 2nd table
Use jQuery - Bootstrap need it anyway
First we need hide class for display - put this in <head></head>
<style>.hide { display: none; }</style>
for a link in 1st table - remove data-toggle and add href..
Link
Then add the function after <html>
... code before ...
</html>
<script>
function toggleDisplay(id) {
if( $('#'+id).hasClass('show') ) {
$('#'+id).removeClass('show');
$('#'+id).addClass('hide');
} else {
$('#'+id).removeClass('hide');
$('#'+id).addClass('show');
}
}
</script>
I didn't have the style for show class because the display can be block or inline and in this case table - so I left it as default
This one is not test yet but I wrote many like this for the past 2-3 years - will be edited/updated after testing :)
P.S. You don't have to use tab this much, it wasting the left-side space (I'm using 2 spaces in place of tab) - save a lot!

Button fill div height using Bootstrap

I want my div col-md-9 to have a height the same as the content in my first div col-md-3's contents.
I also want my div col-md-9's button inside to be the same height as the col-md-3's content.
I'd like the text on the button to fill the button also.
How do I accomplish this?
<div class="row" style="height:300px;">
<div class="col-md-3">
<div class="thumbnail">
<a href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))">
<img src="#(Url.Content("~/Images/LIJayCow-135.png"))" alt="Download Timer App" />
</a>
<div class="caption">
<p>Run the Timer App on your computer to keep track of your time.</p>
<a class="btn btn-primary" href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))">
<span class="glyphicon glyphicon-download"></span> Download
</a>
</div>
</div>
</div>
<div class="col-md-9" style="height:300px; background: #f0e68c">
<div class="thumbnail" style="width:100%; height:300px">
<a class="btn btn-block btn-primary" style="display: block; width: 100%; height:100%; font-size:large" href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))">
<span class="glyphicon glyphicon-share"> LIRA</span>
</a>
</div>
</div>
</div>
All you have to do is change the div with the class "row" to the height you want.
<div class="row" style="height:300px;">
<div class="col-md-3" style="height:100%">
<div class="thumbnail" style="width:100%; height:100%">
<a href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))">
<img src="#(Url.Content("~/Images/LIJayCow-135.png"))" alt="Download Timer App" />
</a>
<div class="caption">
<p>Run the Timer App on your computer to keep track of your time.</p>
<a class="btn btn-primary" href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))">
<span class="glyphicon glyphicon-download"></span> Download
</a>
</div>
</div>
</div>
<div class="col-md-9" style=" background: #f0e68c;height:100%">
<div class="thumbnail" style="width:100%; height:100%;">
<a class="btn btn-primary" style="" href="#(Url.Content('~/ProjectTimer/LITL.DesktopTimer.application'))">
<span class="glyphicon glyphicon-share"> LIRA</span>
</a>
</div>
</div>
</div>
Are you looking for a result like this?
Codepen: link
<div class="row" style="height:300px;">
<div class="col-md-3">
<div class="thumbnail">
<a href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))" >
</a>
<div class="caption" style="height:300px;">
<p>Run the Timer App on your computer to keep track of your time.</p>
<a class="btn btn-primary" href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))">
<span class="glyphicon glyphicon-download"></span> Download
</a>
</div>
</div>
</div>
<div class="col-md-9" style="height:300px; background: #f0e68c">
<div class="thumbnail" style="width:100%; height:300px">
<a class="btn btn-block btn-primary" style="display: block; width: 100%; height:100%; font-size:large" href="#(Url.Content("~/ProjectTimer/LITL.DesktopTimer.application"))">
<span class="glyphicon glyphicon-share" style="font-size: 300px;">LIRA</span>
</a>
</div>
</div>
</div>
Just use the btn-block class, like this:
<div class="col-md-3"><button class="btn btn-block" >Show Details</button></div>
The issue is that the button is 100% height when using h-100, the solution is to set the form element to 100% also.
So it'll look like this:
#using(Html.BeginForm("Action","Controller", FormMethod.Post, new { #class = "h-100" }) {
<button class="h-100">Button</button>
}

how to display products side by side

This is my product template file.
<br>
<div>
<div ng-if="SearchText.length<3" ng-repeat="product in pc.ProductService.Products | filter:FilterExpr:true |orderBy:['SubCategoryName','BrandName'] | groupBy:['BrandName']" >
<h2 ng-show="product.group_by_CHANGED">{{product.BrandName}} </h2>
<div class='box'>
<ng-include src="'commonTemplate.html'"></ng-include>
</div>
</div>
<!-- template (common piece of code) -->
<script type="text/ng-template" id="commonTemplate.html">
<div class="BrandName"> <b>{{product.BrandName}}</b> </div>
<div class="ProductName"> {{product.ProductName}} </div>
<br>
<div> <img src="http://localhost/{{ product.ProductImagePath }}" alt="" border=3 height=75 width=75></img> </div>
<div class="ProductVariants">
<select class="form-control btn btn-default btn-xs text-center" ng-init="SelectedVariant = product.Variants[0]" ng-model="SelectedVariant" ng-options="variant.VariantName for variant in product.Variants" ng-change="ChangeVariant(product.ProductID, SelectedVariant.VariantID)"></select>
</div>
<div class="Price">
<strike> {{SelectedVariant.MRP}} </strike> {{SelectedVariant.SellPrice}}
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart==0">
<a class="btn btn-success btn-sm" ng-click="pc.AddToCart(product.ProductID, SelectedVariant.VariantID)">Add to Cart
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart>0">
<a class="btn btn-default btn-xs" ng-click="pc.PlusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-plus"></span>
</a>
<button type="button" class="btn btn-sm btn-info disabled">{{SelectedVariant.InCart}} in cart</button>
<a class="btn btn-default btn-xs" ng-click="pc.MinusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-minus"></span>
</a>
</div>
</script>
</div>
Box class is defined like this in CSS:
.box {
margin : 5px;
display : inline-block;
width: 170px;
height: 275px;
background-color: #F5FBEF;
text-align:center;
vertical-align: top;
}
When display my product list look like this:
I want to show products side by side.
Can some one help me how to do that?
EDIT:
After changes suggested by Rachel Gallen, it turn out like this:
I want to display brand name in new line when new brand encounters. rest all looks good.
I put in .ng-repeat:display:inline plus a wrapper
#wrapper {
display: inline!important;
height: 275px;
max-width: 540px;
}
.box {
margin: 5px;
display: inline-block;
width: 170px;
height: 275px!important;
background-color: #F5FBEF;
text-align: center;
float: left;
}
.ng-repeat {
display: inline-block;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
<div ng-if="SearchText.length<3" ng-repeat="product in pc.ProductService.Products | filter:FilterExpr:true |orderBy:['SubCategoryName','BrandName'] | groupBy:['BrandName']">
<h2 ng-show="product.group_by_CHANGED">{{product.BrandName}} </h2>
<div id=wrapper>
<div class='box'>
<div class="BrandName"> <b>{{product.BrandName}}</b>
</div>
<div class="ProductName">{{product.ProductName}}</div>
<br>
<div>
<img src="http://localhost/{{ product.ProductImagePath }}" alt="" border=3 height=75 width=75></img>
</div>
<div class="ProductVariants">
<select class="form-control btn btn-default btn-xs text-center" ng-init="SelectedVariant = product.Variants[0]" ng-model="SelectedVariant" ng-options="variant.VariantName for variant in product.Variants" ng-change="ChangeVariant(product.ProductID, SelectedVariant.VariantID)"></select>
</div>
<div class="Price">
<strike> {{SelectedVariant.MRP}} </strike> {{SelectedVariant.SellPrice}}
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart==0">
<a class="btn btn-success btn-sm" ng-click="pc.AddToCart(product.ProductID, SelectedVariant.VariantID)">Add to Cart
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart>0">
<a class="btn btn-default btn-xs" ng-click="pc.PlusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-plus"></span>
</a>
<button type="button" class="btn btn-sm btn-info disabled">{{SelectedVariant.InCart}} in cart</button>
<a class="btn btn-default btn-xs" ng-click="pc.MinusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-minus"></span>
</a>
</div>
</div>
<div class='box'>
<div class="BrandName"> <b>{{product.BrandName}}</b>
</div>
<div class="ProductName">{{product.ProductName}}</div>
<br>
<div>
<img src="http://localhost/{{ product.ProductImagePath }}" alt="" border=3 height=75 width=75></img>
</div>
<div class="ProductVariants">
<select class="form-control btn btn-default btn-xs text-center" ng-init="SelectedVariant = product.Variants[0]" ng-model="SelectedVariant" ng-options="variant.VariantName for variant in product.Variants" ng-change="ChangeVariant(product.ProductID, SelectedVariant.VariantID)"></select>
</div>
<div class="Price">
<strike> {{SelectedVariant.MRP}} </strike> {{SelectedVariant.SellPrice}}
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart==0">
<a class="btn btn-success btn-sm" ng-click="pc.AddToCart(product.ProductID, SelectedVariant.VariantID)">Add to Cart
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart>0">
<a class="btn btn-default btn-xs" ng-click="pc.PlusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-plus"></span>
</a>
<button type="button" class="btn btn-sm btn-info disabled">{{SelectedVariant.InCart}} in cart</button>
<a class="btn btn-default btn-xs" ng-click="pc.MinusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-minus"></span>
</a>
</div>
</div>
</div>
</div>
</body>
</html>
Add property float:left to box class. If that doesn't work, please provide a demo.
Jsfiddle: http://jsfiddle.net/z9jbhmd4/
You can add float in your css:
.box {
margin : 5px;
display : inline-block;
width: 170px;
height: 275px;
background-color: #F5FBEF;
text-align:center;
vertical-align: top;
float: left;
}
And to keep the height of the container, move <div class="box">...</div> inside container like <div class="box-container">.....</div>
Then, add css:
.box-container:after {
content: " ";
display: block;
height: 0;
clear: both;
}