corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Table cell alignment HTML/CSS


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Table cell alignment HTML/CSS
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Aug 10 at 21:22   View Garage View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
19th Aug 10 at 21:27   View Garage View User's Profile U2U Member Reply With Quote

think you need to make div's to achieve this not sure html tables support it
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Aug 10 at 21:28   View Garage View User's Profile U2U Member Reply With Quote

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
19th Aug 10 at 21:40   View User's Profile U2U Member Reply With Quote

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
19th Aug 10 at 21:47   View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Aug 10 at 21:54   View Garage View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Aug 10 at 22:25   View Garage View User's Profile U2U Member Reply With Quote

Give up, ended up doing it with colspans.
AndyKent
Member

Registered: 3rd Sep 05
User status: Offline
20th Aug 10 at 07:38   View User's Profile U2U Member Reply With Quote

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
20th Aug 10 at 08:10   View User's Profile U2U Member Reply With Quote

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.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
FAO: Webmasters: CSS Bart Geek Day 14 1141
24th Oct 06 at 14:57
by Ian
 
Is there a way? (HTML Tables) Steve Geek Day 11 196
25th Jan 07 at 10:02
by drax
 
Vista Screenshots Robbo Geek Day 69 2083
18th Feb 07 at 12:53
by dave17
 
CSS help liamC Geek Day 2 88
10th Sep 08 at 13:07
by Neo
 
CSS Help Jodi_the_g Geek Day 5 719
11th Nov 08 at 16:42
by Jodi_the_g
 

Corsa Sport » Message Board » Off Day » Geek Day » Table cell alignment HTML/CSS 29 database queries in 0.0172658 seconds