Table Being Widened By An Image |
Table Being Widened By An Image |
Xander |
Jun 24 2007, 12:22 AM
Post
#1
|
Group: Members Posts: 1 Joined: 24-June 07 Member No.: 3,169 |
Is there an html tag that will lock in a tables dimensions? I have a table that I put as a width of 500 and height of 500, but then I put an image in one of the table details which has a default size of over 1,000 width and height. When the page loads, the full image is there instead of one that is compressed to the table's 500x500 dimensions. I can't simply put the dimensions in the img src code because I'm using a php code that will recall a certain picture based on one that is clicked, so different pictures will load into that page that might all have different sizes. Please help.
|
Darin McGrew |
Jun 24 2007, 12:42 AM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Is there an html tag that will lock in a tables dimensions? No.I have a table that I put as a width of 500 and height of 500, but then I put an image in one of the table details which has a default size of over 1,000 width and height. When the page loads, the full image is there instead of one that is compressed to the table's 500x500 dimensions. You've got two basic options: crop the image or resize the image.You can use CSS to "crop" the image by specifying the overflow property, but it's better to have your server send a cropped image file. That way you aren't wasting bandwith for a 1000px image that you're only going to show half of. You can use HTML or CSS to "resize" the image by specifying a width of only 500px, but it's better to have your server send a resized image file. That way you aren't wasting bandwidth for a 1000px image that you're going to resize to only half that size. |
Brian Chandler |
Jun 24 2007, 01:05 AM
Post
#3
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
Is there an html tag that will lock in a tables dimensions? I have a table that I put as a width of 500 and height of 500, but then I put an image in one of the table details which has a default size of over 1,000 width and height. When the page loads, the full image is there instead of one that is compressed to the table's 500x500 dimensions. I can't simply put the dimensions in the img src code because I'm using a php code that will recall a certain picture based on one that is clicked, so different pictures will load into that page that might all have different sizes. Please help. If you have a php script recalling the images it is straightforward to get the image size, and if it's outside the limit, resize the image or whatever else is necessary. If you wrote the script yourself this should be obvious - if not you either need to learn how to do it, or get someone to do it for you. I'm sure someone here can help with specific questions... |
Lo-Fi Version | Time is now: 25th April 2024 - 12:15 AM |