Is there a way to transform an HTML table from a horizontal layout to a vertical

I have reorganized the bus seating layout horizontally using a table. However, I now need to transform it vertically for mobile phones without disrupting my existing code.

My attempt at using transform(rotate90deg) achieved the desired result, but the table ended up overlapping with the text. Is there a way to move the table down while still using transform(rotate90deg), or is there another CSS solution that would work better?

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"></script>
<table class="">
                    <!--TODO переключнение этажей, подсветка занятых мест, подсветка выбранных мест-->
                    <tr v-for="stroka in mergeFlights.find(trip => trip.id_trip===busTriptId).bus_config[floor]" :key="stroka">
                      <td v-for="seat in stroka" :key="seat"
                        :rowspan="seat.split('+')[1]" 
                        :colspan="seat.split('+')[2]" 
                        align="center">
                        <div v-if="seat.split('+')[3].replace('_', '') !== ''" :class="se</div>at.split('+')[0]" :id="'seat_'+seat.split('+')[3].replace('_', '')">{{seat.split('+')[3].replace('_', '')}}</div>
                        <div v-else-if="seat.split('+')[0] == 'voditel'" :class="seat.split('+')[0]" :id="'seat_'+seat.split('+')[3].replace('_', '')">{{seat.split('+')[3].replace('_', '')}}</div>
                      </td>
                    </tr>
                  </table>

horizontal bus seating layout

vertical bus seating layout achieved with CSS transform rotate

Answer №1

To enhance the appearance of your content, consider adding CSS styling to:

 <td style = "display: flex; flex-direction: row"> 

You can also define a class name and apply the styles in your CSS file.

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

Tips for establishing a fixed point at which divs cease to shrink as the browser size decreases

There are numerous dynamically designed websites where divs or images shrink as the browser size decreases. A great example of this is http://en.wikipedia.org/wiki/Main_Page The div containing the text shrinks proportionally to the browser size until it ...

Exploring the world of VueJS on Codeanywhere: A beginner's guide

Greetings! I am diving into VueJS and embarking on a project in Codeanywhere: npm install -g vue-cli vue init webpack myProject After running npm run dev, I encounter a Your application is running here: http://localhost:8080 Since I am working on a ...

Displaying a dropdown selection that showcases two object properties lined up side by side

I need the select option dropdown values to display employee names along with their titles in a lined up format. For instance, if my values are: Bob Smith Director Mike Kawazki HR Jane Doe Manager I want them to be shown as: Bob Smith Director Mi ...

"Learn the efficient way to monitor both a ref variable and a reactive object using just one watcher in Vue

Documentation for Vue v3 includes an example of watching multiple refs with a single watcher by passing an array as an argument. You can find it here. I'm curious if and how I can apply a similar approach to watch both a ref and a reactive object sim ...

Serving static files in Django

Currently diving into Django and encountering a hurdle with static files. I've followed the setup in both the settings and HTML, but unfortunately, they are not loading on the website. Seeking assistance to resolve this issue! **settings.py:** STATIC ...

Ensure a button is automatically highlighted within an active class script

I have created a set of buttons that allow users to change the font family of the text. I would like the border and text color to update automatically when a specific option is selected. Currently, the JavaScript code works well, but when the page first l ...

Artistically connect the main navigation bar to the secondary one

I am currently working on developing a responsive website. I am following the "content first" methodology, starting with designing for the smallest mobile layout. The homepage of the site (still under construction) looks something like this: When a user c ...

Which design pattern should I implement to update all table rows except the initial one, while incorporating an AJAX insertion mode?

I am working with a table structure that is dynamic based on search results. The table consists of different rows including titles for categories like Organization, Category, and File. <table class="table-striped col-lg-12" id="results"> <tr& ...

The context of 'this' remains unestablished within the SFC Vue

I am facing a problem where, while hovering over the variable during debugging inside Chrome DevTools, I receive the following output: When checking the DevTools console: Does anyone have any idea why this is happening? It's really frustrating as it ...

Is it possible to include a div above a centered image?

Currently I am working with ImageFlow and I would like to overlay a div on top of the image when it is clicked, sliding it into the center. I have been looking through the JavaScript file but the function MoveIT() seems to be called multiple times and I am ...

Why does the pound symbol in z-index always show up in Angular?

Having an issue with my code where I set a z-index in the CSS like this: .mat-mini-fab { position: absolute; right: 5px; top: 4px; z-index: 999; box-shadow: none !important; } However, whenever I visit my site, the z-index is not being appl ...

Getting rid of the <br> tag as well as the linked <span> element

I've been experimenting with creating dynamic forms. My latest project involves a text box, an 'Add' button, and a div. The idea is that whenever a user types something into the text box and clicks the Add button, that value should appear in ...

Getting the x-axis points on Google charts to start at the far left point

I have integrated the Google API for charts into my application and am using multiple charts on the same page. However, I am facing an issue with setting padding for the charts. When I include more data points, the chart area occupies more space in the div ...

Angular textbox with dynamic concatenated name functionality

Hello, I'm currently working with some code that looks like this: <div *ngFor="let phone of phoneList; let phIndx = index;"> <div class="peoplePhoneTxtDiv"> <input [disabled]="phone.disabled" class="peoplePhoneTxtBox" type="text" ...

What is the most effective method for ensuring a Vue application can accurately interpret the environmental variables configured on Heroku?

I implemented a Vue app that is currently being hosted on Heroku. Since Heroku doesn't support static apps, I decided to create a basic express server to serve my app. //server.js const express = require('express') const serveStatic = requi ...

"Emphasize menu items with an underline as you navigate through the

I am using Gatsby with React and have a navigation menu with links. I would like to make it so that when a link is clicked, a border bottom appears to indicate the current page, rather than only on hover. <ul className="men" id="menu"> ...

What is the best way to implement CSS rules for a hidden submenu?

Can anyone help me figure out how to apply CSS rules for a hidden submenu? I've attempted to use some JavaScript, but it's not working as expected. Below is a sample of the code I'm working with. The idea is that when you click on the anchor ...

Creating a uniform height for images in a Bootstrap 4 carousel across various sizes and screen dimensions

Here is an example of a carousel provided by w3schools: <div id="demo" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ul class="carousel-indicators"> <li data-target="#demo" data-slide-to="0" class="active" ...

Modifying the color of a specific node in jstree

I am attempting to modify the background color of the node I have selected in jstree. $('#syncrep').jstree({ 'core' : { 'data' : repository ...

Combine jQuery and CSS to create a scrollable and extended fixed header

I am experiencing an issue where the header is fixed when scrolled down, but when I scroll back up to the top, it detaches and becomes unfixed again. How can I make the header stay fixed for a prolonged period of time? Are there any specific adjustments I ...