Tips for enlarging images based on table contents in HTML

I have created a table. Then I created another table, but the second table appeared inside the first table.

First table: I inserted an image. Second table: I added some content.

The content in the second table is too large, causing the table to expand but the image in the first table remains the same size. How can I increase the size of the image?

This is the code I used:

<html>
   <head>
    <style type="text/css">
        body {
            font-family: Calibri;
 }
        
        table tr {
            border: none;
        }

        a, a:link, a:visited, a:active {
            text-decoration: none;
            color: #09B0CE;
        }

         img {
            border: none;
            width: 100%;
            height: auto;
        }
      </style>
   </head>

     <body>
                    <table cellspacing="1"  cellpadding="0" align="center" id="main-panel" style="width: 100%; background-color:#f2f2f2; color: rgb(75, 75, 75); border-collapse: collapse; border: 1px solid #f2f2f2;">
        <tbody>
            <tr>

                <td >
                    <table  align="center" width="640px" style="width: 640px; padding: 2px 0px 2px 0px; background-color: #17B8DD">
                        <tbody>
                            <tr>
                                <td style="width:100%;">
                                    <table>
                                        <tr>
                                            <td width="85%" style="padding-top:10px">
                                                <a href="http://www.s.com">
                                                <img src="http://KB/logo.png" alt="S.INC" style="height:auto; width:auto" sizes="80vw"/>
                                                </a>
                                            </td>
                                        </tr>
                      </tbody>
                  </table>
              </td>
          </tr>
     <tr>
                   <td style="padding: 0px 0px 0px 0px;">

                       <table style="color: #4D4D4D; font-size: 14px; font-weight: normal; width: 100%; border:1px solid #cccccc; padding: 10px 0px 10px 20px;" border="1px" cellspacing="2" cellpadding="3">
                           <tbody>
                               <tr style="padding: 10px 10px 5px 10px;">
                                   <th style="width: 32%">Control</th>
                                   <th style="width: 36%">Test Case Name</th>
                                  <th style="width: 32%">Status</th>
                               </tr>

                              <tr style="padding: 10px 10px 5px 10px;">
                                   <th style="width: 32%">EnterpriseServer</th>
                                    <th style="width: 36%">AddPasswordForDataSource_ValidDataSourceIdAndPassword_PasswordAddedInDataSourceDetail</th>
                                <th style="width: 32%">Failed</th>
                             </tr>
                          </tbody>
                      </table>
                   </td>
               </tr>

            </tbody>
            </table>

Answer ā„–1

check out this code snippet

<table cellspacing="1" cellpadding="0" align="center" id="main-panel" style="width: 100%; background-color:#f2f2f2; color: rgb(75, 75, 75); border-collapse: collapse; border: 1px solid #f2f2f2;">
    <tbody>
        <tr>

            <td>
                <table align="center" width="" style="width:100% ; padding: 2px 0px 2px 0px; background-color: #17B8DD">
                    <tbody>
                        <tr>
                            <td style="width:100%;">
                                <table>
                                    <tbody><tr>
                                        <td width="" style="padding-top:10px">
                                            <a href="http://www.s.com">
                                            <img src="http://dakhal.net/Archieves/2/image/news_image_98.jpeg" alt="S.INC style=" width="100%">
                                            </a>
                                        </td>
                                    </tr>
                                </tbody></table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr> <tr> <td style="padding: 0px 0px 0px 0px;">

                <table style="color: #4D4D4D; font-size: 14px; font-weight: normal; width: 100%; border:1px solid #cccccc; padding: 10px 0px 10px 20px;" border="1px" cellspacing="2" cellpadding="3">
                    <tbody>
                        <tr style="padding: 10px 10px 5px 10px;">
                            <th style="width: 32%">Task</th>
                            <th style="width: 36%">Test Case Name</th>
                            <th style="width: 32%">Result</th>
                        </tr>                      <tr style="padding: 10px 10px 5px 10px;">
                            <th style="width: 32%">EnterpriseServer</th>
                            <th style="width: 36%">AddPasswordForDataSource_ValidDataSourceIdAndPassword_PasswordAddedInDataSourceDetail</th>
                        <th style="width: 32%">Failed</th>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>

     </tbody>
     </table>

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 you interested in triggering a personalized event when attempting to sort data in Datatables?

Is there a way to trigger my own event without sorting when the user clicks on a column header? I have looked into different methods, but none seem to be suitable for this purpose. Although I can bind to the sort event to perform custom actions, the sorti ...

Tips for updating the current user's username value in local storage in Angular

https://i.stack.imgur.com/ZA32X.png https://i.stack.imgur.com/iDHZW.png I am facing an issue with updating the local storage of a current User for only username. When I update the username, it's not reflecting in local storage. Even though I can s ...

How can I align the starting point of a Bootstrap div col to the center?

Is it possible to change the layout from this https://i.sstatic.net/Dc8Yi.jpg to this https://i.sstatic.net/TcQU0.jpg? I want the content added to always start from the center and spread to both sides, like in the second image. Can this be achieved? Here ...

What are the best practices for managing mouse events in AlpineJS when working with my menu?

I'm currently tackling the challenge of developing a mega dropdown menu feature using alpine.js and Tailwind CSS. Unfortunately, I've hit a roadblock as I can't seem to get the mouse events functioning correctly. In the snippet below, you&ap ...

Combining JQuery Validator with the power of Django

I wrote a code snippet in my views: def check_username(request): if HttpRequest.is_ajax and request.method == 'GET': username = request.GET['username'] if User.objects.filter(username=username).exists(): ...

Mastering the Art of Restricting an IP Address Range with FILTER_VALIDATE_IP

In order to restrict access to certain resources, I need to implement a system that filters IP addresses. To validate the IP address, I currently use FILTER_VALIDATE_IP and filter_var. However, I am facing an issue where the starting and ending IP address ...

What is the process for retrieving the AJAX response text?

When it comes to my AJAX development, I rely on prototype and utilize the following code: somefunction: function(){ var result = ""; myAjax = new Ajax.Request(postUrl, { method: 'post', postBody: postData, content ...

Tips for getting TypeScript to flag improper string concatenation with different data types

Why does TypeScript not complain in strict mode about the following scenarios? function test(firstName: string, lastName?: string): string { return firstName + " " + lastName; } test('John'); Or this? const str: string = ''; ...

Combining arrays by a shared property in JavaScript

My goal is to merge data from two arrays based on the userId. The current solution I have only works efficiently with small datasets, but it becomes impractical with larger arrays due to the excessive use of the filter method. Does anyone have a more effic ...

Toggle the containment of jQuery draggable elements with a click

I have successfully implemented a jQuery draggable feature, <!DOCTYPE html> <html> <head> <style type="text/css"> .container{ width:400px; height:200px; border:1px solid red; } #draggable{ width: 100px; hei ...

Find the current elapsed time using Wavesurfer in real time

I am currently utilizing the waveSurfer library created by katspaugh for playing audio files. In order to display 'elapsed time / total time', I have written code in the following manner: waveSurfer.on('play', function() { $scope.g ...

What is the quickest method for importing React.js Material Icons in a single line of code?

While working on my initial react.js project as a beginner, I encountered the frustration of having to import Material UI icons individually. This process made my code unnecessarily long and required me to repeatedly visit the browser to copy the icon li ...

Words not within the span, away from the span border

Iā€™m currently in the process of creating a dedicated section on my website called "Voices of the Nation,ā€ which draws inspiration from the foundations laid out in the U.S. Constitution. The objective is to highlight individuals who have shown their sup ...

Here is a step-by-step guide on creating a navigation bar with a Login and Sign Up button using Bootstrap 4

I am in the process of creating a navigation bar in bootstrap 4, which includes Login and Sign Up buttons. To get a clear idea of what I'm aiming for, please refer to the images below: https://i.sstatic.net/ibZKa.png https://i.sstatic.net/OUWsX.png ...

Proper Structure for Node System (BASIC)

Overview Recently, I entered the world of Node.js and built some basic back end functionality. However, I realized that everything was clustered in one file (index.js) which led me to explore tutorials on using express router middleware and adapting a mod ...

Tips for adjusting the alignment of a navbar-brand and navbar using Bootstrap 5

I am currently using bootstrap to develop a webpage. I have a navigation bar at the top of the page and I would like my navbar-brand to be positioned on the right side, while my navbar links should be on the left. However, when I try to implement this, it ...

Encountering a situation where attempting to retrieve JSON data results in receiving an undefined

After fetching JSON data from the API , I successfully printed out text to the console with the correct data. However, when attempting to access any of its properties, they are returning as undefined. var url = "http://www.omdbapi.com/?t=batman&y=& ...

Adjust the CSS of a dynamically generated jQuery checkbox button in real-time

I am working on a project where I am creating a series of jQuery checkboxes dynamically within a loop. Here is how I am doing it: var checkbox = $('<input>').attr({type: 'checkbox', id: checkbox_id); panel.append(checkbox); panel ...

The jQuery CSS selector is retrieving a result enclosed in double quotation marks nested within another pair

When I attempt a jQuery select with a CSS property, I am noticing that the value is being returned enclosed in double quotes twice. Has anyone encountered this issue before? var font = $(this).css('font-family'); The result I get back looks like ...

JavaScript: The function is encountering issues with properly formatting the numbers

I am currently facing an issue with a function I have created to format numbers for currency by inserting commas every 4 digits. The problem lies in the fact that the first 4 numbers do not have a comma added where it should be, and the formatting only wor ...