Good attempt for a first try
(You really only need html in the html panel just from the body onwards and then you put css in the css panel and js in the js panel but do not include the style tags or script tags in those separate panels.)
Anyway I need to ask a couple of questions about this layout.
Firstly you say adding the CSS code changed the page so I assume that removing the css code will show me what it was like before?
I’ve added some dummy images just to test and I see this layout.
Is that the vertical gap you are talking about between the 2 images on the left of that screenshot?
If I remove all the CSS I see this layout.
Was that how it looked to you before (bearing in mind I only added a couple of dummy images)?
If so then you will notice that the images are the same height and therefore there is no gap above or below. The problem with this approach is that the images are squished and you can’t really place real world images like that You have to maintain the image’s inherent aspect ratio.
It may be that I am not seeing what you really have in the full page so bear with me.
The code that is making the difference in the first example is this rule.
img {
max-width: 100%;
height: auto;
width: auto\\9; /* ie8 */
}
Ignore the ie hack as that is nonsense these days and should be removed. The height:auto on the image means the image will maintain its aspect ratio and will not stretch to the full height of the cell. If you remove the height:auto the image will stretch but of course it will not look right.
As I mentioned in my first post you would still need the following css.
td{padding:0}
img{display:block;}
You would also need to address the media query issue I pointed out.
I also wonder whether you have the viewport meta tag in place because without it media queries will not work properly and is the first thing that must be added when dealing with various devices?
This must go in the head.
<meta name="viewport" content="width=device-width, initial-scale=1">
It seems to me that you are using a very old Dreamweaver page (probably 15 years old) and are using js for things that css may be able to do although I was unable to test that aspect in the codepen. It might be time for a re-think to modern standards as tables for layout is semantically incorrect and not something that has been used for the last 20 years.
I realise this may be an old site so you may just have to stick with it and fix the problems in situ.
I’ve thrown a lot at you in this thread but what would help is to see a fully working demo. I assume you have this online somewhere?
Back tomorrow now as its late 