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

Is there a way to extract information from the HTML source code of an external website and display it in my application?

Seeking a method to search an external URL for content that matches "title" and then display the results on my HTML page using Javascript. Despite my efforts with Javascript, I have not come across any resources that address this issue. Could it be that I ...

NUXT: Module node:fs not found

Encountering an error when running yarn generate in a Kubernetes container during production. The same command works fine locally and was also functioning properly in production up until last week. Error: Cannot find module 'node:fs' Require stac ...

Elevate Your Designs: A New Perspective on Vertical Alignment

I am struggling to vertically align my text, which spans multiple lines, while implementing the scroll-over effect. I attempted to include vertical-align: middle; in my code, but unfortunately, it did not produce the desired result. Here is my CSS code: ...

Creating visually appealing layouts with CSS floats and divs while ensuring responsiveness

As I work on bringing my vision to life, I'm experimenting with a mix of floats and divs, along with using a responsive image for the background and text. There's quite a bit involved in this process. 1. To start off, check out this example with ...

Is there a way to sequentially load two iframes, with the second one loading only after the first one is fully loaded

Having two different links that trigger ajax calls can be tricky if only one request is allowed per load. This may result in both iframes displaying the same data. Is there a way to work around this issue? Perhaps loading one iframe first and then triggeri ...

Dynamic row height in MUI DataGrid

I'm currently utilizing the MUI DataGrid component, and I have a specific behavior in mind that I'd like to achieve: When there is a small number of rows present, I want the table to only occupy the necessary space for those rows. On the other h ...

Show a div once all its content has been fully loaded

I have a section on my webpage that includes images, text, and links. It functions as a carousel. My goal is to show the section only after all content has loaded. I am looking to transition from opacity 0 to opacity 1 with a fade-in effect. Here is the ...

Choosing Vue select options depending on a condition

I am working on a dropdown template with Vue.js and have encountered some challenges. Here is the basic structure of my dropdown: <select v-model="selectedClient" class="stat-select text-u-c"> <option disabled value="">Please select a Client ...

Starting a tab just once

I have successfully created 4 static HTML pages that include: Home About Services Contact Each page contains a link that leads to another static page named myVideo.html, which plays a video about me in a new tab. The link is available on every page so ...

How can you confirm the validity of a dropdown menu using JavaScript?

<FORM NAME="form1" METHOD="POST" ACTION="survey.php"> <P>q1: How would you rate the performance of John Doe? <P> <INPUT TYPE='Radio' Name='q1' value='1' id='q1'>1 ...

Using Vuetify's v-data-table to enable row click functionality

Currently, I am involved in a Vue project that utilizes Vuetify as our primary component library. We are using the v-data-table component to display information and redirecting to another view when a row is clicked, which is functioning correctly. During ...

Is there a way to integrate Vue.js components into my static HTML code without any hassle?

I am a beginner with Vue.js and I'm looking to integrate it into one of the pages on my website. The page is currently built with Laravel, jQuery, and other technologies. Specifically, I want to incorporate the Vue.js draggable component into a specif ...

What is the best way to display a component in Vue.js only when the user is redirected from a specific page?

Like the title suggests, I am looking to have a message appear only if the page is redirected from a specific page. I believe it may be related to either this.$router or this.$route, but I'm having trouble figuring it out. ...

Adjust the height value of each element to match the maximum height within a single line using only CSS

There are 3 divs styled with display:inline-block. I aim to adjust their height values so they match the highest one. The desired effect is demonstrated visually below. Is it doable using only CSS? ----- ----- ----- ----- ----- ---- ...

Removing styling from a table header and specific table data cells with CSS

I am trying to create an HTML table where I only want to select cells that are not part of the thead section and do not have a specific class. I am having trouble with the selector for this particular case. table :not(thead):not(.cell-class) { backgro ...

When trying to revisit or reload a Laravel project, the Vue Router URL cannot be found

Each time I revisit the vue-router URL, a 404 page not found error is displayed. My application is built on Laravel 5.8 and defined in web.php file. I have attempted various solutions but none of them seem to be effective. Route::get('/{capture_a ...

Identifying a phantom field error in the console

I'm encountering an issue where I am receiving an error message while attempting to validate my fields using VeeValidate on my system. Uncaught (in promise) Error: [vee-validate] Validating a non-existent field: "". Use "attach()" first. at creat ...

Submitting the form may cause disruptions for others

I currently have an email subscription form for my newsletter that is managed through PHP. This form appears in the footer of every page on my website. Check out a demonstration on JSFIDDLE While the form itself functions properly, I am encountering issu ...

Transform JavaScript variables into CSS variables

Similar Post: Avoiding repeated constants in CSS I am currently working on a javascript file that aims to adjust my site's resolution based on the width and height of the viewport. While I have successfully retrieved these values using JavaScript ...

Why is it that an HTML entity-containing string doesn't show the character after going through the htmlspecialchars() function?

In my project, I have a string of text retrieved from the SQL database which is then sanitized using PHP's strip_tags and htmlspecialchars functions to eliminate any HTML formatting that users might try to inject. This processed text is displayed in b ...