Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

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

Sponsored Links

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
 
LinkBack Thread Tools Display Modes
  #1  
Old June 20th, 2008, 04:33 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 20th, 2008, 04:50 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 20th, 2008, 04:51 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 20th, 2008, 06:19 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 863
Thanks: 20
Thanked 78 Times in 75 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net 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
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding
Reply With Quote
  #5  
Old June 20th, 2008, 07:52 PM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 23rd, 2008, 01:57 AM
don94403's Avatar
Moderator
 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 63
Thanks: 3
Thanked 8 Times in 8 Posts
Blog Entries: 2
Rep Power: 1
don94403 is on a distinguished road

Awards Showcase
Microsoft Access PHP 
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  
Old June 23rd, 2008, 10:11 AM
Barn Frequenter
 
Join Date: Mar 2008
Posts: 197
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  
Old June 23rd, 2008, 10:19 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 255
Thanks: 48
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  
Old June 23rd, 2008, 11:07 AM
BLaaaaaaaaaarche's Avatar
Moderator
 
Join Date: Mar 2008
Posts: 55
Thanks: 10
Thanked 7 Times in 5 Posts
Rep Power: 1
BLaaaaaaaaaarche is on a distinguished road

Awards Showcase
HTML & CSS Classic ASP 
Total Awards: 2

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


All times are GMT -4. The time now is 04:08 PM.



Content Relevant URLs by vBSEO 3.2.0