HTML table cells are too large

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

HTML table cells are too large

Post by Callan S. »

I've tried to set their width - when I wasn't running this inside a CSS page it'd work out alright, but here you can see on the enemy HP that the enemy health is at full, but the bar is long (the enemy health is the right size - 100 pixels). I've put width='100' pretty much everywhere. I suspect it's something to do with the CSS layout that's making it try and fill the space instead of work at a fixed space, but I'm a CSS noob so I dunno! I think the player HP is doing the same problem but I'll just focus on the opponent HP for now.

Any help appreciated! :)
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: HTML table cells are too large

Post by Jackolantern »

You have width = "100" or width: 100px; ? Are you talking about CSS styles?
The indelible lord of tl;dr
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: HTML table cells are too large

Post by Callan S. »

Ah, you put me onto something to try out and search for! Thanks!

I found sticking

Code: Select all

style='width:450px'
in the table finally made it stick to one size rather than self adjusting.

And yeah, I can see it's a style and so I should probably be putting this in a style sheet and using a div here. But for now I'm just happy to get the bars working again!

I'll just leave it a day longer to make sure it all remains working, then I'll edit the title to solved!

And here's a screenshot of the game currently - I'm using a CSS template (that I found that has free use!) now! Which is a nice bit of side polish!
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: HTML table cells are too large

Post by Jackolantern »

Nice looking! :)

And glad I could help, even though I am not sure what I did :lol:
The indelible lord of tl;dr
Post Reply

Return to “Beginner Help and Support”