What is the best way to organize table rows into a single column when the window is resized?

I am working on a table that has three pictures in a row, with 100% width. I want the table to be responsive and stack the pictures into one column when the space is limited.

The issue I am currently facing is that the elements of the table do not stack into one column when the browser window width is minimized or when viewed on a mobile phone, causing the picture on the right side to become invisible.

Below is my code:

http://codepen.io/anon/pen/jPYyeK

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  <style type="text/css">
  .Table-Upper {
    width: 100%;
    text-align: center;
  }
  </style>
</head>
<body>

  <div class="col-sm-2">
    <div class="list-group">
      <a href="#" class="list-group-item active">Start</a>
      <a href="Foo.html" class="list-group-item">Foo</a>
    </div>         
  </div>
  <div class="col-sm-10">
    <table class="Table-Upper">
      <tr>
        <td><img id="upper-pics" src="p1.jpg" width="200"></td>
        <td><img id="upper-pics" src="p2.png" width="100"></td>
        <td><img id="upper-pics" src="p3.jpg" width="200"></td>
      </tr>
    </table>
  </div>
</body>
</html>

Answer №1

When using Bootstrap, tables cannot be used to manage content in columns. Instead, you should utilize <div> elements with appropriate classes for this purpose.

Give this a try

<div class="col-sm-2">
  <div class="list-group">
    <a href="#" class="list-group-item active">Start</a>
    <a href="Foo.html" class="list-group-item">Foo</a>
  </div>         
</div>
<div class="col-sm-10 col-xs-4">
  <div class"row">
    <div class="col-md-3"><img id="upper-pics" src="p1.jpg" width="200">  </div>
    <div class="col-md-4"><img id="upper-pics" src="p2.png" width="100"></div>
    <div class="col-md-3" ><img id="upper-pics" src="p3.jpg" width="200"></div>

  </div>
</div>

Answer №2

After studying the three equal columns layout example on http://getbootstrap.com/examples/grid, I decided to implement it using <div> elements.

<div class="col-sm-10">
    <div class="row" align="center">
      <div class="col-md-4"><img src="p1.jpg" id="upper-pics" width="200"></div>
      <div class="col-md-4"><img src="p2.png" id="upper-pics" width="100</div>
      <div class="col-md-4"><img src="p3.jpg" id="upper-pics" width="200"></div>
    </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Extracting props data from a component in React.js - a step-by-step guide

I am currently developing a react.js application with react-select. I have created a dropdown menu and when an item is clicked, I need to pass that item to a function that is connected to the redux store. How can I retrieve data from a component used in re ...

A guide on how to efficiently retrieve all images stored in a specific directory

I attempted to showcase all the images from a single directory using jQuery, but unfortunately it is not functioning as expected. My folder setup includes an 'images' folder and a 'js' folder. I followed this question on Stack Overflow ...

The vertical spacing in Font "bottom-padding" appears to be larger than anticipated

Recently, I purchased the font Proxima Nova for my project and I am encountering issues with vertical alignment. Despite setting margins, line-heights, and padding to match those of Arial, the results are not consistent as the Proxima Nova appears misalign ...

Interactive Tab content display

I'm working on a tabs component and I need Angular to only render and initialize the active tab instead of all tabs. Is there a way to achieve this? <my-tabs> <my-tab [tabTitle]="'Tab1'"> <some-component></some-co ...

Innovative solutions for seamless transformation of HTML designs into Silverlight 3.0

One of my challenges with clients is getting them on board with web applications. However, I am eager to try something new and explore the potential of Silverlight 3.0. It would be great to see if I can transform some of these applications into fully funct ...

The border should not start at the left of the page; instead, I would like it to begin at the letter "T" in "Tech."

I am having an issue with the bottom border starting from the extreme left of the page. I want it to start from the letter "T" in Tech instead. #page-container { width: 1250px; margin: 0 auto; } h2 { font-weight: normal; padding-left: 15px; ...

Executing JavaScript code from an external link

Currently, I am in the process of developing a horizontal parallax website. The functionality is working seamlessly; when I click on the menu, the slides smoothly transition horizontally and display the corresponding content. However, I have encountered a ...

Having trouble with Viewport CSS being restricted by Blogger?

I've been working on configuring my personal blog, which is hosted on Blogger, to properly adapt to the Windows 8 IE snap feature. Through my research online, it has been suggested that I include a @viewport in the CSS. However, it seems like the CSS ...

Adjust padding of elements based on scrolling movements

Currently, I am attempting to adjust the padding of a specific element based on how far down the page the user scrolls. Ideally, as the user scrolls further down the page, the padding will increase, and as they scroll back up, the padding will decrease. H ...

Combining all elements of my application into a single HTML, JS, and CSS file

My AngularJS app has a specific structure that includes different directories for each component: theprojectroot |- src | |- app | | |- index.html | | |- index.js | | |- userhome | | | |- userhome.html | | | ...

What is the best way to implement CSS in this JavaScript Fetch code in order to manipulate the text's position and font style

Hello, I am just starting out with JS. Is there a way for me to customize the position and font of text in this JS Fetch function using CSS? Any help will be greatly appreciated. let file = 'art.txt'; const handleFetch = () => { fe ...

Tips for storing checkbox preferences in a user account on an HTML/PHP website

Hello! I am currently working on a website. I have included a checkbox that updates the option selected in phpMyAdmin. The issue I am facing is that when I press submit and then refresh the page using F5, the preference I chose disappears on the client s ...

The functionality of the Bootstrap carousel may be compromised when initialized through JavaScript

Why isn't the Bootstrap carousel working in the example below? It starts working when I paste it into .content <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script sr ...

Modify styling of complete list upon clicking in React

For my latest project, I developed a basic todo application using React. One of the key features is that when a user clicks on a checkbox, the corresponding todo item's CSS changes to show a strike-through effect. Additionally, a button appears on hov ...

What is the best way to retrieve the elements stored within the 'this' object I am currently manipulating?

How can I access the elements nested within the 'this' that I am currently operating on? Below is the HTML code that I am currently working with: <div class="expander" id="edu">educational qualifications <ul class="list"&g ...

What is the best way to position the logo in the center of the navigation bar, considering there are an unequal number of menu items on each side

As I work on coding a design I found for practice, I am facing the challenge of getting the logo to be centered in the navbar, similar to the layout in the Dribble link below. View Design on Dribble The navigation bar has 4 items aligned on the left and ...

Simple way to extract the values from every input element within a specific <tr> tag using JQuery

Is there a way to align all input elements in a single row within my form? For example, consider the snippet of code provided below, which includes a checkbox and a text input box. I would like to retrieve the values from both of these input types and pres ...

navigate through laravel pagination to different pages

Is there a way to navigate to a particular page on the pagination? ...

Troubleshooting border-left and td alignment problems in an HTML email displayed in Outlook 2013

Currently, I am facing a frustrating challenge while working on an HTML email signature. It seems to display perfectly in all email clients except for Outlook 2007, 2010, and 2013. The specific issue I'm encountering is with the alignment of the secon ...

Is it possible to access the ID element of HTML using a variable in jQuery?

I have fetched some data from a JSON ARRAY. These values include Value1,Value2, and Value3. Additionally, I have an HTML checkbox with an ID matching the values in the array. My goal is to automatically select the checkbox that corresponds to the value re ...