The presented data in the HTML table is displayed in a reverse horizontal order

I am in the process of developing a calculator and have chosen to use Bootstrap4 tables for the button alignment. However, I am facing an issue where the table is being rendered in the reverse order of the code that I have written. The columns within the table are appearing reversed.

<table class="table text-center table-sm table-borderless mt-2">
<tbody>
    <tr>
        <td colspan="2">
            <div class="btn-group btn-group-justified" role="group">
                <button type="button" class="btn btn-grey btn-left">Rad</button>
                <button type="button" class="btn btn-grey">Deg</button>
            </div>
        </td>
        <td><button class="btn btn-grey btn-block ripple border">x!</button></td>
        <td><button class="btn btn-grey btn-block ripple border">(</button></td>
        <td><button class="btn btn-grey btn-block ripple border">)</button></td>
        <td><button class="btn btn-grey btn-block ripple border">%</button></td>
        <td><button class="btn btn-grey btn-block ripple border">AC</button></td>
    </tr>
    <tr>
        <td><button class="btn btn-grey btn-block ripple border">inv</button></td>
        <td><button class="btn btn-grey btn-block ripple border">sin</button></td>
        <td><button class="btn btn-grey btn-block ripple border">ln</button></td>
        <td><button class="btn btn-light btn-block ripple border">7</button></td>
        <td><button class="btn btn-light btn-block ripple border">8</button></td>
        <td><button class="btn btn-light btn-block ripple border">9</button></td>
        <td><button class="btn btn-grey btn-block ripple border">÷</button></td>
    </tr>
    <tr>
        <td><button class="btn btn-grey btn-block ripple border">π</button></td>
        <td><button class="btn btn-grey btn-block ripple border">cos</button></td>
        <td><button class="btn btn-grey btn-block ripple border">log</button></td>
        <td><button class="btn btn-light btn-block ripple border">4</button></td>
        <td><button class="btn btn-light btn-block ripple border">5</button></td>
        <td><button class="btn btn-light btn-block ripple border">6</button></td>
        <td><button class="btn btn-grey btn-block ripple border">x</button></td>
    </tr>
    <tr>
        <td><button class="btn btn-grey btn-block ripple border">Ɛ</button></td>
        <td><button class="btn btn-grey btn-block ripple border">tan</button></td>
        <td><button class="btn btn-grey btn-block ripple border">√</button></td>
        <td><button class="btn btn-light btn-block ripple border">1</button></td>
        <td><button class="btn btn-light btn-block ripple border">2</button></td>
        <td><button class="btn btn-light btn-block ripple border">3</button></td>
        <td><button class="btn btn-grey btn-block ripple border">−</button></td>
    </tr>
    <tr>
        <td><button class="btn btn-grey btn-block ripple border">Ans</button></td>
        <td><button class="btn btn-grey btn-block ripple border">EXP</button></td>
        <td><button class="btn btn-grey btn-block ripple border">X<sup>y</sup></button></td>
        <td><button class="btn btn-light btn-block ripple border">0</button></td>
        <td><button class="btn btn-light btn-block ripple border">.</button></td>
        <td><button class="btn btn-primary btn-block ripple border"><b>=</b></button></td>
        <td><button class="btn btn-grey btn-block ripple border">+</button></td>
    </tr>
</tbody>
</table>

https://codepen.io/sivaramakrishnan/pen/RwwzWQa

Answer №1

The alignment of text in your HTML document determines the direction.

https://i.sstatic.net/GmNwh.png

For a better understanding, check out this link. When you specify it in HTML, all text will follow suit. However, with the use of a css property, you can control which parts go in that specific direction. By applying these properties to a div, for instance, you can achieve the desired result.

https://www.w3schools.com/cssref/pr_text_direction.asp

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 adding an image into a PDF document using the jsPDF library in HTML

Due to the lack of support for utf8 characters in jspdf, I'm experimenting with replacing some characters with images before exporting to pdf. To illustrate, I've created a code sample where I insert an image into an html div and then attempt to ...

Could the wizard control sidebar be customized to have a similar appearance?

Can I make my asp.net wizard side bar look like the one shown here: I'm not sure if it's possible since SideBarStyle usually only allows for basic styling like changing font color and size. ...

Is there a way to direct to a specific URL upon clicking a button using PHP?

In my PHP code called registerprocess.php, it executes after clicking a submit button on another page named userregistration.php. If a user tries to register with an email that already exists in the database, I want registerprocess.php to redirect back to ...

Creating a interactive navigation bar with External JSON data in HTML and JavaScript

Is there a way to create a dynamic MenuBar by using an external JSON file? How can I write HTML code to fetch and display JSON data dynamically? What is the process for reading a JSON file? //JSON File = Menu.Json {"data": [{"id": "1", "text": "F ...

Utilizing Angular controllers to access data attribute values from child elements

Today I embarked on the journey of learning AngularJs through online tutorials. Excited about my new project, I started working on creating some useful features using Angular. Here is a snippet of my progress so far: The HTML Part <div data-ng-control ...

Why is my Bootstrap 4 NavBar displaying a mysterious blank space on the right?

Kindly look at the image provided. The issue of white space only appears on the full-screen webpage, not on mobile or tablet views. /**** Nav Bar elements**/ .navbar{ z-index: 1; width: 100%; margin: 0; } .navbar-default{ background-col ...

Using Django variable in li a:nth-child selector produces unexpected results

Currently, I am honing my web programming skills by working on a personal blog in Django. However, I have encountered a hurdle. My intention was to enable the webpage to recognize which menu element is active by passing an argument from views.py to the tem ...

What fate befalls CSS rules left untouched?

Within my style.css file, I have applied rules to almost every component on the website. However, there are exceptions such as the main template and sections displaying requested pages which may contain unique parts not found in other pages, utilizing the ...

How to create a freeze panes feature like MS Excel using HTML and CSS

In my web application for iPad using Angular JS, HTML5, and CSS3, I'm facing a challenge with a large table that requires both horizontal and vertical scrolling, along with a "freeze-pane" feature similar to MS Excel. Currently, I've divided the ...

Mastering the art of horizontal alignment in forms

So, within my render function, the following code is used: render() { <div> <form id="one"> <TextField id="t1" ... /> <Button id="b1" /> </form> <div id="empty"><div ...

CodeMirror version 5.62.3 is experiencing some challenges with the scrollbar functionality, editor size, and line wrapping

During my HTML/CSS/JS coding session, I encountered a challenge with CodeMirror version 5.62.3. Specifically, I was striving to make the scrollbar visible in the code editor, using C# as the language mode. However, despite setting the editor's height ...

What is the importance of ensuring that user registration is done consistently?

While working on a user registration feature, I noticed that the character restrictions for the 'username' field in some sample codes are quite limited, only allowing '.', ''', and '-'. No spaces or other specia ...

Triggering an animation on one element by hovering over a different element

I'm trying to create a cool effect where the train ticket rotates when I hover over a leaf. Although I can get the train ticket to rotate when I hover over it directly, it doesn't seem to work when I hover over the leaf. Can someone help me spot ...

Enhanced jQuery implementation for hiding elements

I encountered a peculiar issue where jQuery's .is(':hidden') function wrongly returned true for an element that visibly displayed content. You can see the problem demonstrated in this fiddle. The :hidden pseudo checks both offsetWidth and o ...

CSS: the max-width property does not constrain an absolute positioned container from overflowing

I've been trying to figure this out for hours, but I can't seem to get it right. My top menu has submenus that include a popup menu. In one of my popups, I need the container to have a maximum width of 170 pixels and all the items inside to wra ...

Tips for switching out images depending on the time of day

Currently, I have a script that dynamically changes the background color of my webpage based on the time of day. However, I am facing issues trying to implement a similar functionality for replacing an image source. The current code is also time zone-based ...

Outputting Javascript code from a PHP variable can be achieved by utilizing the echo function

I've been diving into Cross Site Scripting and decided to test some vulnerable examples we were given in class. Currently, I'm experimenting with a form that stores its value in $_REQUEST['in'] of PHP upon submission. The stored value i ...

Using the explode function to parse an XML file and extract the data into a unified array output

My XML file can be found here. I am currently parsing it using the following code: <?php $xml=simplexml_load_file('info.xml'); foreach($xml->testcase as $var){ $var=explode('/',$var->script); $module =array($var[2]) ...

Tips for creating semi-circular shapes using CSS gradients

I am trying to design a div element with a background made up of two colors divided by a half circle: My preference is to use gradients for easier animation purposes. I am looking to avoid using pseudo-elements or border-radius, and my HTML structure limi ...

Click on the event to save the document and print the HTML page

Is there a way to create an onclick event that saves the current HTML page as a document and then prints it? <html> <body> <div class="reportformat"> <div class="format1"> <table> <tr ...