HTML - Cell width issue

Author
Discussion

JayBM

Original Poster:

450 posts

195 months

Thursday 28th July 2016
quotequote all
Afternoon all,

Before my laptop goes through the window I'm hoping that someone could help me with an issue I have with my wife's website. I've inherited the site and I'm in the process of redesigning it but we need to get an additional page added in the short term.

I've created the page and managed to create the layout using tables but for the life of me I can't work out why browsers are rendering the 1st cell on the 3rd row as 172px when it's coded to be 52px. At 52px, the sum of the columns adds up to exactly the specified width of the table so there shouldn't be any calculation to be done.

http://www.theladiesorganicmilk.co.uk/media.asp

Any help would be greatly appreciated.

Thanks
James

craigsup

282 posts

102 months

Thursday 28th July 2016
quotequote all
It's rendering as 52px for me.
Both the 3rd and 4th row's first column render as 52px wide.

JayBM

Original Poster:

450 posts

195 months

Thursday 28th July 2016
quotequote all
Thanks Craig, although odd as I've tried it in all 4 major browsers and it displays as below. Whilst the image renders correctly at 52px, the actual cell is 172.5px with an empty 120.5px on the right. It also shrinks the middle cell, that spans 3 columns, to 520.5px rather than the 641px it should be.


craigsup

282 posts

102 months

Thursday 28th July 2016
quotequote all
JayBM said:
Thanks Craig, although odd as I've tried it in all 4 major browsers and it displays as below. Whilst the image renders correctly at 52px, the actual cell is 172.5px with an empty 120.5px on the right. It also shrinks the middle cell, that spans 3 columns, to 520.5px rather than the 641px it should be.

Ah I didn't have the website on show when viewing - I just looked at the HTML (I'm at work so they'd question why I was looking at that site haha).

If you don't have a successful post on here by the time I get home, roughly 5pm, I'll take another look for you - may be helpful if you PM me your code as that'll be easier to spot the issue.

JayBM

Original Poster:

450 posts

195 months

Thursday 28th July 2016
quotequote all
Thanks Craig, really appreciated.

Mr Kitten

996 posts

227 months

Thursday 28th July 2016
quotequote all
I'm not an amazing HTML wrangler... but try changing your table style to:

<table style="table-layout:fixed;/* width:800px; */align-content:center;padding:0;border-collapse:collapse;" id="Table_01" cellpadding="0" cellspacing="0" align="center" border="0">

JayBM

Original Poster:

450 posts

195 months

Thursday 28th July 2016
quotequote all
biggrin thank you, you've saved me a new laptop. Although I'm sure I'd removed the width statement previously and it had no affect, but commenting it out seems to have worked!

Thank you again beer

Mr Kitten

996 posts

227 months

Thursday 28th July 2016
quotequote all
No worries... virtual beers all round!

Penelope Stopit

11,209 posts

109 months

Sunday 31st July 2016
quotequote all
You have a couple of problems with this site, the site is not mobile friendly and it is also very narrow on my monitor...see image

JayBM

Original Poster:

450 posts

195 months

Tuesday 2nd August 2016
quotequote all
Penelope Stopit said:
You have a couple of problems with this site, the site is not mobile friendly and it is also very narrow on my monitor...see image
Hi,

Yes I agree 100%, the company who originally created the site created a fixed size design @ 800x600 and as you say it is not a responsive layout either.

The 2 new pages are a temporary measure whilst I create a whole new layout.

Penelope Stopit

11,209 posts

109 months

Tuesday 2nd August 2016
quotequote all
OK you are on the case...sorry to bother you with what you already know

JayBM

Original Poster:

450 posts

195 months

Wednesday 3rd August 2016
quotequote all
No bother at all smile