Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Apologies for the noob question but it's doing my head in and I would be quicker getting a proper answer than continuing to faff.
I have a table cell with some text on the left and three images on the right.
I want the cell content to span 100% of the cell - ie. the text perhaps 3px from the left and the images the same from the right side of the cell. I also want everything to be centred vertically. Kind of like -
code:
+----------------------------------------------+
| +-----+ +-----+ |
|text left aligned | img | | img | |
| +-----+ +-----+ |
+----------------------------------------------+
[Edited on 19-08-2010 by Ian]
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
think you need to make div's to achieve this not sure html tables support it
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Yeah the table isn't important only that what you see is a table cell. Hopefully that won't affect what lives in there too much.
|
AndyKent
Member
Registered: 3rd Sep 05
User status: Offline
|
Put a div inside the cell with the images inside and float that right. Put some padding on the cell itself of 3px.
valign the cell and should be working no?
|
AndyKent
Member
Registered: 3rd Sep 05
User status: Offline
|
so.....
<tr><td width="300" style="paddingpx 3px 0px 3px">
<div style="float:right"><img src="#"><img src="#"><img src="#"></div>
This is the contents
</td><tr>
?
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
No the text is still at the top of the cell with that.
Should be able to see it here - http://www.corsasport.co.uk/board/forumdisplay.php?fid=67
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Give up, ended up doing it with colspans.
|
AndyKent
Member
Registered: 3rd Sep 05
User status: Offline
|
Well actually I did miss the valign bit, so each opening td would become:
<td width="300" style="padding: 0px 3px 0px 3px" valign="middle">
....but thats still all off the top of my head.
Nevermind, works with colspans well enough so might as well leave it.
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
You'd need to use div's and the css display property to get the elements to behave like tables and float and position properties to get everything in the right place. Probably add a bit of margin in there too for alignment.
|