Graphic refusing to remain within table boundaries

image outside of container

I'm having trouble keeping the image in the left column, as it seems to hover over the table. How can I ensure that it stays within the table boundaries?

<table align="center" style="width:550px" id="table" cellpadding="5">
  <tr>
    <th style="text-align: left" rowspan="2">
      <img src="avi.png" alt="" id="avatar" />
    </th>
    <th style="text-align: left">
      <h1 id="hello">My Resume</h1>
    </th>
  </tr>
  <tr>
    <td style="text-align: left">
      <p>Hello this is a crazy little test that i am doing to see if this code works</p>
    </td>
  </tr>
</table>

Answer №1

If you are aiming for a design similar to the example you provided, it's recommended to avoid using tables as they can be cumbersome and outdated. Instead, consider utilizing flexbox, which offers a straightforward method of aligning elements and creating visually appealing layouts.

For instance:

body {
  font-family: 'Helvetica Neue', Helvetica, sans-serif;
}
.resume {
  display: flex;
  align-items: center;
  justify-content: center;
}
.resume-picture {
  border: 10px solid #1976D2;
  border-radius: 50%;
  background: #f3f2f1;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  height: 175px;
}
.resume-content {
  padding: 0 15px;
}
.resume-content h2 {
  color: #1976D2;
  margin-top: 0;
}
.resume-content p {
  color: #333;
  margin: 0;
}
<div class="resume">
  <img class="resume-picture" src="https://avatars2.githubusercontent.com/u/3534427?v=3" />
  <div class="resume-content">
    <h2>My Resume</h2>
    <p>Hello this is a crazy little test that i am doing to see if this code works.
      <br>Hello this is a crazy little test that i am doing to see if this code works.
      <br>Hello this is a crazy little test that i am doing to see if this code works.</p>
  </div>
</div>

Hopefully, this aligns with what you had in mind.

Answer №2

Customize image over text

<table align="center" style="width:550px;border:1px solid #c2c2c2;    position: relative;" id="table" cellpadding="5" border="0">
  <tr>
    <th style="text-align: left;border-right:1px solid #c2c2c2;min-width:50px;" rowspan="2">
      <img src="https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/user.png" alt="" id="avatar" width="100" height="100" style="
        position: absolute;
        bottom: 0;
        left: 14px;
        top: 33px;
        z-index: 2;
        opacity: 0.5;" />
    </th>
    <th style="text-align: left;border-bottom:1px solid #c2c2c2;">
      <h1 id="hello">My Resume</h1>
    </th>
  </tr>
  <tr>
    <td style="text-align: left">
      <p>Hello this is a crazy little test that i am doing to see if this code works</p>
    </td>
  </tr>
</table>

image within table container updated styling

<table align="center" style="width:550px;border:1px solid #c2c2c2;" id="table" cellpadding="5" border="0">
  <tr>
    <th style="text-align: left;border-right:1px solid #c2c2c2;" rowspan="2">
      <img src="https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/user.png" alt="" id="avatar" width="100" height="100" />
    </th>
    <th style="text-align: left;border-bottom:1px solid #c2c2c2;">
      <h1 id="hello">My Resume</h1>
    </th>
  </tr>
  <tr>
    <td style="text-align: left">
      <p>Hello this is a crazy little test that i am doing to see if this code works</p>
    </td>
  </tr>
</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

Display the modal values in a hidden form field within a textarea, and then it will be automatically

Within my setup, there are two forms. The first form contains a textarea, while the second form appears in a modal. Below is the code for form 1. <div> <textarea name="dynamic-content-unit" id="dynamic-content-unit" class="for ...

The CSS theme toggler for Bootstrap

I am currently working on integrating a style switcher following the instructions provided at . However, when I add a title="" attribute to the CSS link, the CSS file fails to load on the page and the styles revert back to default Bootstrap. I have added ...

Troubleshooting issues with document.querySelectorAll in JavaScript

Can someone explain why document.querySelectorAll isn't functioning properly in this code snippet? I'm a beginner and could use some help. <p id="demo">This is a paragraph.</p> <h1 id="1demo"> Hello </h1&g ...

Update Input field by eliminating white spaces using jQuery version 3.2.1

I am currently developing an HTML/PHP form for user registration. Using the code below, I have managed to prevent any blank spaces from appearing in the input field: <!DOCTYPE html> <html> <head> <script> function stripspaces( ...

Embracing the cutting-edge technology of the Wordpress revolution slider for an HTML

Is it possible to integrate the WordPress Revolution Slider into a website without using WordPress (just HTML and CSS)? I've attempted to search for JavaScript solutions, but there are too many scripts available. ...

Issue with jQuery where it returns "undefined" when trying to access the CSS display property

On my page, there are several divs with default display styles set in an external .css file. When a certain condition is met, I use jQuery to turn one on and the others off using the fadeIn() and fadeOut() methods. However, I've noticed that in Firef ...

Inject HTML from an external source into several div elements that share the same class

I am currently working on creating a portfolio showcasing my music albums through CD covers. On my portfolio page, I have all the content of my albums loaded initially, but it is hidden within divs. When an album is clicked, the content expands and colla ...

The size of table cells automatically adjusts when zooming in the browser

While trying to display my table in Chrome, I noticed that the cell sizes of the table change when zooming in. Additionally, the table is rendered incorrectly in other browsers like IE and Firefox. I attempted adjusting the sizes to percentage values but i ...

ConnectionError: 404 Page Not Located

Why am I receiving downvotes? This is the second time I've been downvoted. Please, at least tell me the reason so that I can improve. I am currently using the jQuery get method to send data from HTML to PHP (both are hosted on localhost/Site1). Edit ...

Guide on how to use JavaScript to make an HTML5 input field mandatory

I am facing an issue with setting input fields as required based on radio button selection in a form. Initially, all fields should have required=false, but I'm unable to achieve this. No matter what value I assign to the required attribute, it always ...

Reverse typing phenomenon

I am currently working on creating a unique backwards typing effect in my code. I want the <P> tag to initially display "Coming Soon" and then type out that phrase backwards before transitioning forward to "SeaDogs.com.eu.as" As of now, I have made ...

What is the best way to reveal or conceal a div element on mouseover with jQuery?

Currently, I have a table with the following structure. <table> <tr> <td id="divOne">div one</td> <td id="divOne">2222</td> </tr> <tr> <td id="divOne">d ...

Retrieving CSS file using admin-ajax.php in WordPress

The website has been tested on GTmetrix and you can view the report here I am puzzled as to why admin-ajax.php is causing a delay of over 3 seconds in loading time on this particular page that I am attempting to optimize. It seems to be related to a CSS ...

How to access elements that are dynamically added using Jquery

Similar Question: dynamic class not triggering jquery unable to select dynamically added element I am facing an issue trying to access a dynamically added element by its class name. Here is a snippet of the HTML code I am working with: <div c ...

Error message: The function 'NavController' is not recognized, it is undefined

Upon launching the app, I encounter an error. Below is the controller code: myApp .controller('NavController', ['$scope', '$location', function ($scope, $location) { $scope.navClass = function (page) { ...

Challenges with displaying HTML website on mobile platform

Hey there! I admit that my website may not be the greatest, but bear in mind that this is just a school project page. My current issue is with the mobile view styling - the hamburger menu should replace the nav bar on smaller screens, but it's not wor ...

How to use jQuery to change the background color of HTML table cells based on their content value

A dynamic table will be displayed based on the dropdown element selected. Below is a snippet of the code: <table id="myPlaneTable" class="table table-bordered"> <tr> <td style="width: 20%">Max speed</td> <td ...

Simple method to automatically close dropdown menu when clicking outside of it

One challenge I encountered was managing a dropdown list that opens when clicking a button and closes when clicking outside the button. To achieve this functionality, I implemented a solution using `HostListener` as shown below: @HostListener('click& ...

There was a lack of dynamic content on the webpage when using the view/template engine (Handlebars)

I'm currently using the Handlebars template engine in my project. Despite not encountering any errors in the console, I'm facing an issue with displaying dynamic content in the index.hbs file that is rendered from app.js. app.js const express = ...

Click Event for Basic CSS Dropdown Menu

My goal is to develop a straightforward feature where a dropdown menu appears below a specific text field once it is clicked. $(".val").children("div").on("click", function() { alert("CLICK"); }); .container { display: inline-block; } .val { d ...