Is merging cells in a table possible?

Is there a way to incorporate a YouTube video into a table with specific formatting requirements?

I'd like the left and right columns to be 2 rows high, while the middle column should contain 2 cells - one for the video at the bottom and one for text at the top. However, I'm struggling to position the elements correctly.

<div class="cbody">
        <table class="ctable">
            <tr>
                <td rowspan="2" style="width:105px"><img class="cimg1" src="meh.png" alt=" " width="100px" height="500px"></td>
                <td><p class="ctxt">
                my text here
                </p></td>
                <td rowspan="2" style="width:105px"><img class="cimg2" src="meh.png" alt=" " width="100px" height="500px"></td>
            </tr>
            <tr>
            <iframe width="420" height="315" src="http://www.youtube.com/embed/xI_6oLPC-S0" frameborder="0" allowfullscreen></iframe>
            </tr>
        </table>
    </div>

also CSS...

.cbody {
width:800px;
margin-left: auto;
margin-right: auto;
border-style:solid;
border-width:3px;
}

.cimg1 {
padding-left:5px;
padding-top:5px;
padding-bottom:5px;
float:left;
}

.cimg2 {
padding-left:5px;
padding-top:5px;
padding-bottom:5px;
float:right;
}

.ctxt {
margin-left:5px;
margin-right:5px;
text-align:center;

}

.ctable {
width:800px;
margin-left:auto;
margin-right: auto;
border-style:solid;
border-width:2px;
}

Answer №1

It's important to enclose the <iframe> in <td> tags, like so:

<td>
    <iframe width="420" height="315" src="http://www.youtube.com/embed/xI_6oLPC-S0" frameborder="0" allowfullscreen>
    </iframe>
</td>

Consider using <th> instead of <td> when inserting text.

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

What is the best way to create rounded corners for a side menu in an Ionic application using ion-menu in its native form

After extensive research and exploring XCode, I have been unable to achieve the desired venmo style rounded corners for my iOS application. It seems that iOS is not adhering to the sass rules I have specified. The styling of the side menu is dictated by a ...

When resizing the window, the width change in JQuery always resets to 0

I've been trying to adjust the width of a div element when the window is resized, but for some reason, the width always ends up being 0 after the resize event. function resizeUploadField() { var uploadInputField = $('.input-append&apo ...

The method I used to position a triangle at the bottom border of a parent element with relative

https://i.stack.imgur.com/RZjJ9.png I am trying to achieve a centered triangle within a border, but I am facing a challenge due to the parent component being relative. When I remove the relative positioning, I struggle to position the triangle in the cent ...

Insert content into a designated DIV

Progress bars are essential for tracking certain metrics. Take a look at the progress bars below: <div id="lifeBar-holder"> <div id="lifeBar"></div> </div> <div id="discretionBar-holder"> <div id="discretionBar"&g ...

Jumping pictures using jQuery

I would like to create a bouncing effect for some images on my website. http://jsfiddle.net/d7UjD/43/ $('#bbb').mouseenter(function() { $(this).stop().effect('bounce',500); }); $('#bbb').mouseleave(function() { $(thi ...

Using an External Stylesheet with Polymer 2.0: A Step-by-Step Guide

I am still learning the ropes, so please bear with me... Currently, I am attempting to customize a Polymer 2.0 custom element by utilizing an external stylesheet. However, for some reason, the styles from the external stylesheet are not being applied to t ...

`Getting smaller screen hides navigation menu - CSS problem`

As I work on developing my website, I have encountered a small issue with the top navigation bar. It functions perfectly at a certain screen resolution, but when I adjust the browser window or view the site on my iPad, the navigation bar disappears. I&apos ...

Suggestions for automatically adjusting the height and width of a div containing z-indexed content

I'm attempting to automatically adjust the height and width of the parent div that contains three stacked images, but the parent is not adjusting to the dimensions of the content. Even when the div and the last image are on the same z-index, it's ...

Error message: snapscroll plugin failing to activate

I'm having trouble implementing snapscroll on my website even though I followed the documentation. It specifically mentions that SnapScroll only works with containers set to 100% window height for single page sites. Here is the link to Snapscroll: Y ...

Issue with toggle button not functioning properly when used with htmlFor in NextJS

I'm currently working on implementing a toggler that, when clicked, will hide certain elements. Specifically, I want it to hide the sidebar once it's functioning correctly. However, I've hit a roadblock and can't seem to figure out how ...

The alignment of list bullets is inconsistent across different web browsers

Check out this code snippet on JSFiddle: http://jsfiddle.net/PZgn8/8/. It's interesting to see how the rendering differs between Chrome 27 and Firefox 21. Despite the difference, I believe Firefox is actually displaying the desired outcome. <ul st ...

Create tab title CSS design that coordinates with the tab content and features circular corners

I am currently working on creating html + css tabs with a unique design. The goal is to have the selected tab display the title connected to the tab content, with a "neck" rounding in like an arrow. After some progress, I have reached a point where the im ...

Enhance Your Designs with CSS3 Animated Text in SVG Artifacts

I am noticing some glitches in text animations/scaling in various modern browsers including Chrome 29, IE10, Safari 5.1 (Windows), Safari 6.0.5 (Mac), and Opera 16. Surprisingly, Firefox (tested with version 23) seems to be working fine on Windows except f ...

Accessing an image within a label using Jquery

I'm struggling with accessing the img tag when a specific checkbox is selected in order to add a particular class. I need help figuring out how to target the img tag. <div class="row "> <div class="col-md-5 col-md-offset-1 col-centered ...

What steps should I take to have a specific input prompt a certain action?

I am currently working on creating a function that checks when a user inputs a number between 0 and 8, triggering an action corresponding to that specific number. For example, if the user enters 5, a picture and text should appear; whereas if they input 3, ...

Adjust the baseline of the text within the <li> element by moving it 2 pixels upwards

My webpage menu is set up with inline lis within a ul. Each li has a colored border and contains an a element. I want to change the color of the text inside the a element and move it 2 pixels up when hovering over it without affecting the li border. How ...

Using Tailwind CSS to create responsive designs without relying on properties for larger screen sizes

When designing for smaller screens (mobile version - screen width less than 600px), I typically use this: <div className="flex flex-col"/> However, for larger screens (screen width greater than 600px), I prefer not to use "flex-col" anymor ...

JavaScript is having trouble properly concealing or revealing elements on the webpage

I am currently designing a web form for my wife, who works at an insurance agency. She needs a web-based form to collect information for processing insurance quotes. Without access to a server, I need to ensure that all the details inputted by the user can ...

Troubleshooting problems with tooltips when utilizing a custom arrow in jQuery UI

Utilizing the Tooltip custom style plugin presents a challenge for me... My goal is to have my tooltip message appear like those seen on websites and in the image provided (for instance, incorporating an arrow into the tooltip): Sample link Sample link ...

Is there a way to adjust the brightness value in a CSS filter using JavaScript without affecting the other filter attributes?

My goal is to implement CSS filter effects using JavaScript selectedItem.style.filter. However, when trying to apply the brightness attribute, it removes the contrast attribute. Here is the code snippet: $('.brightness').on('input', fun ...