Position the DIVs at the bottom of the TD

I'm having trouble aligning two DIVs within a table TD to the bottom of the table. Despite trying various alignment methods, the left DIV simply won't move. It's crucial for me to design this email responsively, ensuring it still displays correctly when the window is narrowed.

For those who want to take a look at my code on JSFiddle: http://jsfiddle.net/hirenshah/rdux8vkg/

This is the HTML snippet:

<body bgcolor="#C0C0C0">
    <!--[if (gte mso 9)|(IE)]>
        <table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td>
                <![endif]-->
                <table class="container" width="300px" cellpadding="0" cellspacing="0" style="max-width: 600px; background-color: white; margin-left: auto; margin-right: auto;">
                    <tr>
                        <td>
                            <!-- Header Table Start -->
                            <table width="100%" cellpadding="0" cellspacing="0" >
                                <tr>
                                    <td style="text-align: center; vertical-align:bottom; font-size: 0;">
                                        <div class="headercolumnright">
                                            <img src="http://hirenshah.co.uk/poc/logo.png" width="50%"/></div>
                                        <div class="headercolumnleft ">Reference: 123456789</div>
                                    </td>
                                </tr>
                            </table>
                            <!-- Header Table End -->
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
            </tr>
        </table>
    <![endif]-->
</body>

And here is the CSS snippet:

@media screen and (min-width: 601px) {
    .container {
        width:600px !important;
    }
    .headercolumnright {
        text-align:right !important;
    }
}
.headercolumnleft {
    width: 300px;
    display: inline-block;
    text-align:left;
    float: left;
    font-size:12pt;
}
.headercolumnright {
    width: 300px;
    display: inline-block;
    text-align:left;
    float: right;
    font-size:12pt;
    vertical-align:bottom;
}
div {
    outline: 1px solid red;
}

Answer №1

To resolve the issue, attempt switching the placement of the left DIV and the right div...

<tr>
 <td style="text-align: center; vertical-align:bottom; font-size: 0;"> 
 <div class="headercolumnleft ">Reference: 987654321</div>
 <div class="headercolumnright">
   <img src="http://example.com/logo.png" width="50%"/></div>                                 
                                </td>
                            </tr>

I tested this solution in your JSFiddle, and it worked without any issues.

Regards, River.

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

Are there any better methods for creating div backgrounds and borders using CSS?

Within my application, there exists a multitude of div elements that share identical backgrounds and borders but vary in size. Having to utilize the same background image for each individual div proves to be highly inefficient, particularly in terms of ba ...

PHP: Create a list of checkboxes and submit them via form

Following a SQL query, I receive a form displaying a list of data, each line accompanied by checkboxes. The purpose is to allow users to select certain lines for deletion from the database upon form submission. In order to identify which lines are selecte ...

Creating a dynamic button with Angular that appears when focused

I want to have a button appear when the user focuses on an input with the ng-model=query. I know there is an ng-focus directive, but how can I implement it? <input type="search" ng-model="query"> <!--this is the button I need to show once th ...

Issues with Jquery/AJAX function not responding to onChange Event

I am currently working on a project where I need to populate a dropdown menu based on the value selected from another dropdown. However, I am encountering an issue with the function that I am trying to call in the onChange event of the select tag. This is ...

Having difficulty navigating to a different page in Angular 4

I'm currently attempting to transition from a home page (localhost.com) to another page (localhost.com/listing). Although the app compiles correctly, I encounter an issue where nothing changes when I try to navigate to the new page. My approach has m ...

How to create a dynamic background color animation in jQuery similar to a progress bar animation

I have a container with text content (for example: My Name) and it is displayed in a RED background color along with a button. What I am looking for : When the button is clicked, I want to change the background color of the container from RED to BLUE, si ...

styled components are having issues with background gradients and opacity not functioning properly

Hello, I am currently working with styled components and have the following global style code: const GlobalStyle = createGlobalStyle` html{ font-family: roboto; background: linear-gradient(45deg,rgba(137,255,255,0.5),rgba(161,252,143, 0 ...

What are the best practices for preloading images, JavaScript, and CSS files?

Back in the late 90's, I was really passionate about creating websites from scratch. However, as I dove back into web development recently, I realized how much the landscape has changed since then. As more of a designer than a developer, I opted to us ...

Utilizing jquery and ajax to submit a form seamlessly without the need to refresh the web page

I've been struggling to submit a form without refreshing the entire page. I integrated some source code that I found, but for some reason, it's not working! Here is the HTML form I'm trying to submit: <form method="POST" action="" name= ...

Can you explain the purpose of the "for" attribute in the <output> tag of HTML?

I'm puzzled by the purpose of the for attribute in the new HTML5 output tag, as the result doesn't seem to change based on its presence. This query was raised back in 2012 during the era of HTML4. However, with the introduction of HTML5 in 2014, ...

Hovering over the Instagram icon will reveal a stunning visual effect

I am looking to change the appearance of my Instagram icon when hovering over it. I want the background to turn white and the icon to become colored. Here is my code snippet from Footer.js : <a href="https://www.instagram. ...

Content within iframe is failing to load correctly on both Firefox and Internet Explorer browsers

On my website, I have 4 iframes embedded in 4 different tabs. I've noticed that the content is being cropped when viewed on Firefox, but it loads properly when using Chrome. Strangely, if I manually reload the iframe, the content displays correctly. T ...

Full-screen Bootstrap burger navigation menu

Check out this code snippet on boot ply: I'm trying to create a full-screen menu with the same effect as the burger menu for non-mobile screens. Currently, the burger menu only shows up on mobile devices. Does anyone know how I can achieve this? Than ...

Can the autoscroll offset be adjusted while dragging?

I am developing a single-page application using Vue.js. The user interface consists of three main components: A fixed navbar at the top with a z-index of 2 A fixed sidebar on the left with a z-index of 1, and padding to accommodate the navbar A central ar ...

What is the proper way to eliminate the port from a URL so that the images sourced from the XAMPP database can function correctly?

I am a beginner in Angular and I am facing an issue with Angular and XAMPP. I am attempting to load images from mySQL database where I stored their destinations. The problem is that Angular is trying to access that destination through this link: This is m ...

CSS uses color parameters in the same way

Apologies, I spent a few years immersed in the world of IT. Now, onto my query: I have a lengthy ".css" file with numerous structures like color: #567567; within it. Is there a way to utilize a construction similar to color: $mycolor or is this not po ...

The perplexing problem of scrolling in Dojox/mobile/scrollableview

I've noticed some scroll issues with the dojox/mobile/ScrollableView (version 1.10+) in my cordova application, specifically on Android phones. This problem seems to be affecting other widget-based architectures and even some store apps as well. I wou ...

Incorporating an unique identification code within the input field

I have a HTML code that displays geolocation information: <span id="currentLat"></span>, <span id="currentLon"></span> When combined with JavaScript, it works perfectly. However, I am trying to display the above value in a text fi ...

Aligning the image at the center within a flex container

I am struggling with aligning an image and a link inside a div using the display: flex property. This is how my code looks: <div style="display: flex;"> <div class="site-title-container"> <img style="border-radius: 7px; width: 34px; h ...

Building an Angular 4 app featuring a customized default landing page and URL parameters functionality

I am in the process of developing a web portal that will be embedded within an iFrame. Below is the code snippet I am using to set up the portal: Routes Configuration const routes: Routes = [ { path: '', redirectTo: '/dash ...