Jump to content

HTML Help

Go to solution Solved by Guest,
6 minutes ago, KuJoe said:

Just ignore my code completely if you're planning on using tables, my code will only work if you're just looking at displaying 3 images next to each other with each one equal of width (except you can't divide 100 by 3 equally so one of them will be 34% while the other 2 are 33%).

Here's what I used:

 

<table width="100%" align="center">
	<tr>
		<td width="33%"><img src="whateveryouwant.jpg" width="100%"></td>
		<td width="33%"><img src="whateveryouwant.jpg" width="100%"></td>
		<td width="33%"><img src="whateveryouwant.jpg" width="100%"></td>
	</tr>
</table>

 

I am currently coding a website for a school project. I have 3 images in a table (1 cell each) and the table stretches to 100% of the page. How do I get it so that the images will always stretch to 1/3 of the table (while still maintaining aspect ratio)

Link to comment
https://linustechtips.com/topic/605912-html-help/
Share on other sites

Link to post
Share on other sites

I wouldent use a table, tables are nooot good for responsiveness. Use divs.

n0ah1897, on 05 Mar 2014 - 2:08 PM, said:  "Computers are like girls. It's whats in the inside that matters.  I don't know about you, but I like my girls like I like my cases. Just as beautiful on the inside as the outside."

Link to comment
https://linustechtips.com/topic/605912-html-help/#findComment-7849183
Share on other sites

Link to post
Share on other sites

5 minutes ago, GoodBytes said:

Post your code.

But you can set the width and height of an image to a percentage.

 

my code looks a little something like this:

 

<table width="100%" align="center">
  <tr>
    <td><img src="picture1.png"></td>
    <td><img src="picture2.png"></td>
    <td><img src="picture3.png"></td>
  </tr>
</table>

 

Link to comment
https://linustechtips.com/topic/605912-html-help/#findComment-7849202
Share on other sites

Link to post
Share on other sites

Something like this?

<div style="width:33%;float:left;border:1px solid black;"><img src="image1.ext"></div>
<div style="width:34%;float:left;border:1px solid black;"><img src="image2.ext"></div>
<div style="width:33%;float:left;border:1px solid black;"><img src="image3.ext"></div>

 

-KuJoe

Link to comment
https://linustechtips.com/topic/605912-html-help/#findComment-7849206
Share on other sites

Link to post
Share on other sites

3 minutes ago, KuJoe said:

Something like this?


<div style="width:33%;float:left;border:1px solid black;"><img src="image1.ext"></div>
<div style="width:33%;float:left;border:1px solid black;"><img src="image2.ext"></div>
<div style="width:33%;float:left;border:1px solid black;"><img src="image3.ext"></div>

 

would that work?...let me try

Link to comment
https://linustechtips.com/topic/605912-html-help/#findComment-7849209
Share on other sites

Link to post
Share on other sites

4 minutes ago, KuJoe said:

Something like this?


<div style="width:33%;float:left;border:1px solid black;"><img src="image1.ext"></div>
<div style="width:33%;float:left;border:1px solid black;"><img src="image2.ext"></div>
<div style="width:33%;float:left;border:1px solid black;"><img src="image3.ext"></div>

 

Just keep in mind that I'll use divs within the table cells....just easier to keep things neater :P

Link to comment
https://linustechtips.com/topic/605912-html-help/#findComment-7849211
Share on other sites

Link to post
Share on other sites

Just ignore my code completely if you're planning on using tables, my code will only work if you're just looking at displaying 3 images next to each other with each one equal of width (except you can't divide 100 by 3 equally so one of them will be 34% while the other 2 are 33%).

-KuJoe

Link to comment
https://linustechtips.com/topic/605912-html-help/#findComment-7849237
Share on other sites

Link to post
Share on other sites

6 minutes ago, KuJoe said:

Just ignore my code completely if you're planning on using tables, my code will only work if you're just looking at displaying 3 images next to each other with each one equal of width (except you can't divide 100 by 3 equally so one of them will be 34% while the other 2 are 33%).

Here's what I used:

 

<table width="100%" align="center">
	<tr>
		<td width="33%"><img src="whateveryouwant.jpg" width="100%"></td>
		<td width="33%"><img src="whateveryouwant.jpg" width="100%"></td>
		<td width="33%"><img src="whateveryouwant.jpg" width="100%"></td>
	</tr>
</table>

 

Link to comment
https://linustechtips.com/topic/605912-html-help/#findComment-7849256
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×