When a width is specified, the text does not adjust accordingly

I am facing an issue with setting a width on a specific text within my layout. In this Fiddle, I have highlighted the text in red that needs to occupy half of the column width. However, whenever I try to set a specific width, it interferes with the responsiveness of the design.

The reason for using table layouts is due to the requirement of email newsletters and utilization of the foundation framework.

How can I adjust the width of the column containing the red text without compromising its responsiveness?

<body>
      <table class="body">
        <tr>
          <td class="center" align="center" valign="top">
            <center>
                <table class="row footer">
                    <tr>
                        <td class="wrapper">


                            <table align="center" class="container">
                              <tbody>
                                <tr>
                                  <td>
                                    <table class="row">
                                      <tbody>
                                        <tr>
                                          <th class="small-12 large-6 columns first">
                                            <table>
                                              <tr>
                                                <th style="color:red;">Details about the room</th>
                                              </tr>
                                            </table>
                                          </th>

                                          <th class="small-12 large-6 columns last">
                                            <table>
                                              <tr>
                                                <th>Lorem ipsum dolor sit amet, lectus fringilla optio nulla dolorem duis, augue neque mus gravida, platea pharetra duis eros nunc eget. Integer facilis. A convallis nec libero leo tempus, facilisis ac, fringilla at quis, lectus inceptos ac eu suscipit. Porta ac dignissim nec, cursus aliquam senectus aliquam, in duis vestibulum at risus libero volutpat, mi aliquam, tristique sit nunc fermentum</th>
                                              </tr>
                                            </table>
                                          </th>
                                        </tr>
                                      </tbody>
                                    </table
                                  </td>
                                </tr>
                              </tbody>
                            </table>
                        </td>
                    </tr>
                </table>    
            </center>
          </td>
        </tr>
    </table>
    </body>

Answer №1

I have adjusted the width of the first and last th elements to be 50%. If I understand your question correctly, you want to split the row into two sections each with half of the total width.

You can view an example here: fiddle

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

Enhancing User Experience with React Hover Effects

I'm currently in the process of developing a React component library, and I'm looking to enhance the components with some stylish flair. Everything seems to be working smoothly, but I'm interested in changing the background color when a user ...

Enhancing Your Website with Interactive Highlighting Tags

Looking at the following html: Let's see if we can <highlight data-id="10" data-comment="1"> focus on this part only </highlight> and ignore the rest My goal is to emphasize only the highlight section. I know how to emphasize a span ...

Angular 6 animation moving forward (utilizing animation-fill-mode in Angular)

My CSS animated property is functioning properly with the code snippet below: animation: collapse1 0.3s forwards; However, I now need to transition to Angular animations. Everything is working correctly, except for one issue: once the animation completes ...

Guide to making control bar fade out when video is paused on video.js

Is there a way for the control bar to automatically disappear when the video is paused? Thank you in advance! ...

`Calculate sum of dropdown selection values using jQuery`

Currently, I am in the process of developing a form that enables users to select various services and see the total cost displayed. At the moment, I have managed to calculate the running total for one service selected from a dropdown menu. However, I am en ...

Avoid loading external scripts from third-party sources such as JavaScript libraries, Bing Maps API, and Lighthouse performance tool

Issue: The Bing maps API I incorporated into my assignment is loading unnecessary CSS and scripts, causing a noticeable decrease in my lighthouse scores. Is there a way to prevent third-party code (such as Bing Ads) from loading when fetching the maps for ...

Positioning of bottom navigation bars

Is there a way to ensure that the bottom navigation bar remains fixed at the bottom of the screen, regardless of the device's screen size? position: absolute; bottom: 0; width: 100%; While this solution works, it has been observed that when th ...

How can you obtain the reference to the triggering element in a JavaScript event handler?

I am facing an issue with an element that has an event handler attached in this way: <button type="button" onClick="buttonUsed()">X</button> The function linked to this event is as follows: function buttonUsed() { this.innerHTML="used"; } ...

Chrome is inaccurately reporting the outerHeight value, while IE and FireFox are displaying it correctly

The jquery.smartWizard plugin includes a function called fixHeight that adjusts the height of a wizard step. It is utilized when displaying a step for the first time or revealing hidden divs within the step. The function works correctly in IE and FireFox, ...

What is the best way to combine two sections in html/css/bootstrap?

I've been trying to create a simple webpage with a navigation bar and a section below it, but I keep running into an issue where there's unwanted white space between the nav bar and the next section in blue. Is there a way to eliminate this gap a ...

Accessing new information seamlessly without the need for page refresh

For optimal mobile viewing of my website, I am considering implementing a select element. Here are the available options: HTML: <select name="select-choice-8" id="select-choice-nc"> <optgroup label="News"> & ...

Having trouble getting custom tabs in jQuery to function properly?

I am facing an issue with a simple script I have created. The script is supposed to display a specific div when a user clicks on a link, and hide all other divs in the container. However, when I click on the link, nothing gets hidden as expected. Even afte ...

Enhancing the appearance of text by applying a background color solely to its length

After conducting thorough research on the issue, I have come across various solutions that could potentially address it. However, despite my best efforts, I am unable to implement these solutions successfully. The problem at hand involves providing a colo ...

Tips for creating a high-quality file upload button in Laravel 5 using Bootstrap 4

I need a file upload input similar to the one showcased in this example <input type="file" id="dp_file_input" name="demo" /> The current file input design is not visually appealing, so I am looking for a solution like the one demonstrated in the ...

Can I incorporate HTML within a ternary operator in PHP code?

Is it possible to achieve the following example? <? $foobar = 1; $foobar==0 ? ?> <span>insert html here.</span> <? : ?> <span>a different text.</span> <? ; ?> Unfortunately, the code above does not work as ...

The marriage of a sticky and floating navigation bar using the power of Bootstrap 4

I am currently designing a navigation bar inspired by the layout on the EA GAMES website. While it functions perfectly in Chrome, I am encountering significant display issues in Internet Explorer. Any suggestions on how to troubleshoot and resolve this pro ...

Creating a row in your HTML frontend with automated three-column cards

Hello everyone, I am currently new to Django and also learning HTML simultaneously. I am working on a small project in Django, but encountering a problem with the frontend part, specifically related to HTML elements. As you can see in the image attache ...

Saving Information from an HTML Form Input?

I am currently working on a form that collects information about employees including their name, age, position, and details. When the "Add Record" button is pressed, this information should be added to a designated div. Although I have set up the Object C ...

Retrieve the element that matches the specified data attribute value

I'm looking to target an element by its data attribute in jQuery or JavaScript, and then add a CSS class using the addClass method. Can anyone help me with this? I've experimented with various .attr and .prop methods, but they haven't achie ...

Update the section tag upon submission using jQuery on a jQuery Mobile HTML page

I have integrated a jquerymobile template into Dreamweaver 6.0 to create a mobile app interface. The home screen features four buttons - specifically, View, Create, Update, Delete. Upon clicking the Create button, a new screen is opened (each screen corres ...