Flow down tables with bootstrap - html

I have a responsive bootstrap table (1 tr and 3 td) and when it comes to xs devices I want them to flow down.
<div class="container-fluid" id="maincontent">
<div class="table-responsive">
<table class="table"><tr><td>
<div class="thumbnail" id="tropthumb">
<img src="images/mainconimg/trophy.jpg" alt="trophies" id="mainconimg">
<div class="caption">
<h3 id="trop">Trophies</h3>
<p>View</p>
</div>
</div>
</td>
<td>
<div class="thumbnail" id = "medalthumb">
<img src="images/mainconimg/medals.jpg" alt="trophies" id="mainconimg2">
<div class="caption">
<h3 id="medal">Medals</h3>
<p>View</p>
</div>
</div>
</td>
<td>
<div class="thumbnail" id = "souvnthumb">
<img src="images/mainconimg/souvn.jpg" alt="trophies" id="mainconimg3">
<div class="caption">
<h3 id="souvn">Souvenirs</h3>
<p>View</p>
</div>
</div>
</td></tr></table>
</div>
</div>
**I have this table with single row and 3 td on it and each of td contains a thumbnail image. And when it comes to xs devices I want them to flow down like in the example picture please help me with this.
this is what i wanted to look like when it comes to xs devices

Are you using tables for a specific purpose? Because if not, you can use the grid on Bootstrap.
e.g.
<div class="row">
<div class="col-md-4 col-xs-12"> "your image here" </div>
<div class="col-md-4 col-xs-12"> "your image here" </div>
<div class="col-md-4 col-xs-12"> "your image here" </div>
</div>
But you can omit the code col-xs-12 because I think col-md-4 automatically flows them down if you resize your screen.

Related

i want a card loop in html bootstrap but it didnot work properly the cards vertically align after each other

I want to create cards in a loop runtime but the card show vertically align eachother i gave the col-md-4 but it didnot work
enter code here
<div class="row-fluid border mt-3">
<div *ngFor="let data of allWidgets">
<div class="col-md-4 border mt-3">
<div class="card">
<div class="img1">
<img src="https://images.havenly.com/unsafe/550x334/filters:quality(50)/https://s3.amazonaws.com/static.havenly.com/assets/2a35d539-e889-405e-b495-815aa33f65ea" alt="">
</div>
<div class="img2">
<img src="https://images.havenly.com/unsafe/180x180/filters:quality(50)/https://s3.amazonaws.com/havenlydesignerphotos/13078-profile-eb69eheadshot02.jpg" alt="">
</div>
<div class="mian-text mt-0">
<p>{{data.name}}</p>
<p><small>{{data.description}} </small> </p>
View Profile <span style="color: lightgray;">|</span> Select Cherise
</div>
</div>
</div>
</div>
you must use the ngFor not on the first div but on the second like this :
<div class="col-md-4 border mt-3" *ngFor="let data of allWidgets">
this is the solution of your problem.
if you want to create a good angular card you must see:https://mdbootstrap.com/docs/angular/
is the most used site in angular.
have a nice day :)

I am facing problem with the bootstrap 3 CSS class="thumbnail"

I wanted three images in each row...
<div class="row">
<div class="col-lg-4">
<div class="thumbnail">
<img src="https://images.pexels.com/photos/1714208/pexels-photo-1714208.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500">
</div>
</div>
<div class="col-lg-4">
<div class="thumbnail">
<img src="https://images.pexels.com/photos/2103864/pexels-photo-2103864.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500">
</div>
</div>
<div class="col-lg-4">
<div class="thumbnail">
<img src="https://images.pexels.com/photos/1476321/pexels-photo-1476321.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500">
</div>
</div>
I expected it to be inside the border and all the images should have been of same size (three in each row) ...But its not.. help...
You have <div class="thumbnail">, but the built-in bootstrap 3 thumbnail classname is <div class="img-thumbnail">.
You say you want all images to be the same size, but your images have different proportions. Their pixel sizes are: 500x333, 500x750, and 500x375. What behavior do you want exactly? You could force them to all be the same height and width by setting adding styles for height=500px; width=500px;, but then the images will be distorted and squashed.
What you'll want to do is remove &w=500 from the image URLs so they scale to the dynamic width of the Bootstrap grid, and maybe also change the class on the columns to col-md-4 or col-sm-4 to make sure the images sit next to each other on smaller screens.
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<img src="https://images.pexels.com/photos/1714208/pexels-photo-1714208.jpeg?auto=compress&cs=tinysrgb&dpr=1">
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<img src="https://images.pexels.com/photos/2103864/pexels-photo-2103864.jpeg?auto=compress&cs=tinysrgb&dpr=1">
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<img src="https://images.pexels.com/photos/1476321/pexels-photo-1476321.jpeg?auto=compress&cs=tinysrgb&dpr=1">
</div>
</div>
</div>
If you want all three images to have the same height as well, you could do something like this:
.thumbnail img {
max-height: 300px;
}
To achieve true dynamic uniformity, you should look at using Bootstrap 4 card groups instead.

Stuck trying to align things HTML CSS

So I keep trying to align images and text to the center and they keep appearing on the left side of the screen can someone help.
<div class="container">
<div class="col-md-6 col-sm-6 hidden-xs">
<div class="row">
<p class="borderexample3">
<font color="white" class=> Recent News</font>
</p>
</div>
<h1><font color="white"><font face="roboto-bold,roboto,sans-serif"<h1 align="right">Keep Updated!</font></h1>
<div style="text-align: center"><img src="assets/img/fwah.jpg" /></div>
</div>
</div>
This is what shows up.
http://prntscr.com/kgc5c2
I would like it where my red guidelines are on this image.
http://prntscr.com/kgc5tn
Try pushing your columns using col-sm-push-#.
<div class="col-sm-push-3 col-sm-6 hidden-xs">
try this
<div class="container" align="center">
I guess you have to add the following lines in wherever you want to make it center:
style="text-align:center;"
<div class="container">
<div class="col-md-6 col-sm-6 hidden-xs">
<div class="row">
<p class="borderexample3" style="text-align:center;">
<font color="black" class=""> Recent News</font>
</p>
</div>
<h1 style="text-align:center;"><font color="black"><font face="roboto-bold,roboto,sans-serif"<h1 align="right">Keep Updated!</font></h1>
<div style="text-align: center"><img src="assets/img/fwah.jpg" /></div>
</div>
</div>

Creating a centered block of images within a Bootstrap Container

I wish to have a group of centered images arranged in a certain way on the homepage of a bootstrap site. To look like the image below:
I want them to remain centered and then shrink when we go to mobile, with the "freeshipping block" not displaying so it just the two horizontal blocks below 750px.
I have set up a Plunker with the code I have
https://plnkr.co/edit/l6rbmEZQbqGZYifBmF5k?p=preview
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-sm-12 customer-greeting">
<p class="intro_text">My opening blurb of text</p>
<div class="offerscontainer">
<div class="offeroftheday">
<a href="product_info.php?products_id=221">
<img class="img-responsive" src="http://i.imgur.com/TQ6gwoO.jpg">
</a>
</div>
<div class="freeshipping">
<img class="img-responsive" src="http://i.imgur.com/Xqw75nl.jpg">
</div>
<div class="24hrdelivery">
<a href="index.php?cPath=53">
<img class="img-responsive" src="http://i.imgur.com/F3JTlas.jpg">
</a>
</div>
</div>
</div>
Should I be adding float classes or should they all be bootstrap col-8-sm, col-4-sm etc?
PS - Should #queries be used in Bootstrap sites or should they pretty much all layout be handled in the HTML code with col-8-sm (bootstrap classes) etc
You can do it like this..
HTML
<div class="container">
<div class="row">
<div class="col-sm-8">
<img class="img-responsive width-100" src="http://i.imgur.com/TQ6gwoO.jpg">
<br>
<img class="img-responsive width-100" src="http://i.imgur.com/TQ6gwoO.jpg">
<br>
</div>
<div class="col-sm-4">
<img class="img-responsive width-100" src="http://i.imgur.com/Xqw75nl.jpg">
</div>
</div>
</div>
CSS
.width-100 { width: 100%; }
You can write col-md-* or col-sm-* depending on your requirement!

How to place image next to the text both centered in Foundation 5?

I'm trying to have image next to the headline in one row, both centered in Foundation 5. Example is here.
HTML
<div class="row">
<div class="panel small-12 column">
<div class="row">
<div class="small-5 column text-right">
<img src="http://placehold.it/60x60&text=logo" />
</div>
<div class="small-7 column text-left">
<h1>APP NAME</h1>
</div>
</div>
</div>
</div>
In this example solution isn't ideal because it is not centered exactly especialy on the large screens.
I've also tried something like this:
HTML
<div class="row">
<div class="panel small-12 column text-center">
<img src="http://placehold.it/60x60&text=logo" />
<h1>APP NAME</h1>
</div>
</div>
But it doesn't work: image isn't centered. What is the best way how to do this in Foundation 5?
Since an img is an inline element and h1 is a block element, you should put the image inside the heading. See the JSFiddle demo.
<link href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.5.0/css/foundation.min.css" rel="stylesheet"/>
<div class="row">
<div class="panel small-12 column text-center">
<h1><img src="http://placehold.it/60x60&text=logo" alt="" /> APP NAME</h1>
</div>
</div>
Additionally, alt is a required attribute, so I've added one with a blank value.