DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Web Design > HTML & CSS Help

Discuss "align problem" in the HTML & CSS Help forum.

HTML & CSS Help - Discuss HTML, DHTML, XHTML and Cascading Style Sheets (CSS) here. Get tips on how to design your web site.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old June 20th, 2008, 04:33 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default align problem

Hi,

I have a table cell that i am having problems with

I have a image which is 300 px wide and i want some text to be centered in reference to the image.

Also the image has to be centered with the table cell

here is my code
Code:
.nametd
{
width:381.73px;
text-align:left;
height:287.244px;
padding-left:12px;
border-left:white dashed 1px;
border-bottom:white dashed 1px;
border-collapse: collapse;
}

<table>
<tr>
<td class="nametd"><br/><br/><br/>
<img src="/images.one.jpg" width="300px" style="align:left; "><br/>
<span style="font-size:40pt;">Joe</span><br/>
<span style="font-size:40pt;">Doe</span><br/>
<span style="font-size:20pt;">CEO</span><br/>
<span style="font-size:21pt;">Company</span></td>
</tr>
</table>
Its just not working can someone tell me what i am doing wrong

todd
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old June 20th, 2008, 04:50 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

I tried it like this

Code:
.imglineup
{
text-align:center;
width:300px;
display:block;

}

.nametd
{
width:381.73px;
text-align:center;
height:287.244px;
border-left:white dashed 1px;
border-bottom:white dashed 1px;
border-collapse: collapse;
}
Code:
<table>
<tr>
<td class="nametd"><br/><br/><br/>
<img src="/images.one.jpg" class="imglineup"><br/>
<span style="font-size:40pt;">Joe</span><br/>
<span style="font-size:40pt;">Doe</span><br/>
<span style="font-size:20pt;">CEO</span><br/>
<span style="font-size:21pt;">Company</span></td>
</tr>
</table>
Reply With Quote
  #3 (permalink)  
Old June 20th, 2008, 04:51 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

doesnt work
I need to center the image first with reference to the table cell and then the name should be centered with reference to the image
Reply With Quote
  #4 (permalink)  
Old June 20th, 2008, 06:19 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Can you provide a link to the page, or, using something like MS Paint, could you draw a picture of how it shoud look?
__________________
jmurrayhead
Did I help you out? Make me popular by clicking the icon!

If you found a post helpful, please click the button in the lower right-hand corner of the post.

Powered by ASP.Net
Reply With Quote
  #5 (permalink)  
Old June 20th, 2008, 07:52 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

Hi,

I am attaching an image how it should look like

The outside rectangle is the table cell
then the image is aligned center with reference to the table cell
then the text is aligned center in reference to the image

thanks for all your help

todd
Attached Images
File Type: jpg two.jpg (10.9 KB, 5 views)
Reply With Quote
  #6 (permalink)  
Old June 23rd, 2008, 01:57 AM
don94403's Avatar
Moderator


 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 46
Thanks: 2
Thanked 5 Times in 5 Posts
Blog Entries: 2
Rep Power: 1
don94403 is on a distinguished road

Awards Showcase
PHP Microsoft Access 
Total Awards: 2

Default

Unless I'm misunderstanding your question, just style the <td> with text-align:center;

I don't understand what you're trying to accomplish with all the other styling, particularly using text-align:left;

And why would you need to style the height and width of the <td>? If you need space around the image, you can use padding:10px; or whatever.
Reply With Quote
  #7 (permalink)  
Old June 23rd, 2008, 10:11 AM
Contributing Member

 
Join Date: Mar 2008
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

anyone with any ideas
Reply With Quote
  #8 (permalink)  
Old June 23rd, 2008, 10:19 AM
Rebelle's Avatar
Contributing Member

 
Join Date: Mar 2008
Posts: 165
Thanks: 32
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

i see what you want it to look like....but what does it look like with the code you posted?
Reply With Quote
  #9 (permalink)  
Old June 23rd, 2008, 11:07 AM
BLaaaaaaaaaarche's Avatar
Moderator

 
Join Date: Mar 2008
Posts: 43
Thanks: 10
Thanked 6 Times in 4 Posts
Rep Power: 1
BLaaaaaaaaaarche is on a distinguished road

Awards Showcase
Classic ASP 
Total Awards: 1

Default

Why are you using tables? Use divs and css styling.
__________________
"You'll never be as perfect as BLaaaaaaaaarche."
Reply With Quote
Reply

  DeveloperBarn Forums > Web Design > HTML & CSS Help

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 12:39 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46