Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 12-19-2009, 11:56 AM   #1
Active Warrior
War Room Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 21
Thanked 4 Times in 3 Posts
Default Tables in XHTML

I offically hate tables...

And even more so in XHTML

I can't get these bad boys centered...

Code is currently --
**************************************************
<table width="600" height="200" border="0" style="border:dashed" bordercolor="#000000" align="center">
<tr>
<td height="188">
</td>
</tr>
</table>
**************************************************
I even tried adding <div align="center"></div>
Tags...

Nothing.

Strangely enough -- In IE everything is centered, but there is no border.

But in every other browser -- FF, Chrome etc -- there is a border but it is left aligned.

I am so confused right now as to how I can be having such different results...

If anyone can help I would be EXTREMELY grateful

JR
JRecard is offline   Reply With Quote
Old 12-19-2009, 12:45 PM   #2
HyperActive Warrior
War Room Member
 
VisualWebEffects's Avatar
 
Join Date: Sep 2009
Location: Canada
Posts: 137
Thanks: 4
Thanked 35 Times in 18 Posts
Contact Info
Send a message via Skype™ to VisualWebEffects
Default Re: Tables in XHTML

use div's is better. like this:

Style Sheet Class:

Code:
#centeredDiv {
	width: 600px;
	height: 188px;
	text-align:center;
	margin: auto;
	border: 1px dashed black;
}
and the div html code:

Code:
<div id="centeredDiv">test content</div>

VisualWebEffects- Web Application Development, PC Software Development and Identity Design services
VisualWebEffects is offline   Reply With Quote
Old 12-19-2009, 12:50 PM   #3
Active Warrior
War Room Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 21
Thanked 4 Times in 3 Posts
Default Re: Tables in XHTML

Awesome thanks -- Validator doesn't want me using div's at all.

Perhaps thats just inline...

That top code is for external CSS use I presume?

Sorry - started learning HTML/XHTML yesterday

Thanks for the help
JRecard is offline   Reply With Quote
Old 12-19-2009, 12:58 PM   #4
HyperActive Warrior
War Room Member
 
VisualWebEffects's Avatar
 
Join Date: Sep 2009
Location: Canada
Posts: 137
Thanks: 4
Thanked 35 Times in 18 Posts
Contact Info
Send a message via Skype™ to VisualWebEffects
Default Re: Tables in XHTML

you can put the css in between the <head> and </head> tags like so:
Code:
<style type="text/css">
#centeredDiv {
	width: 600px;
	height: 188px;
	text-align:center;
	margin: auto;
	border: 1px dashed black;
}
</style>
or you can put it in an external file EG: styles.css and link it in the document (put this in between the <head> and </head> tags:

<link href="styles.css" rel="stylesheet" type="text/css" />

inside the styles.css you would have:

Code:
@charset "utf-8";

#centeredDiv {
	width: 600px;
	height: 188px;
	text-align:center;
	margin: auto;
	border: 1px dashed black;
}

VisualWebEffects- Web Application Development, PC Software Development and Identity Design services
VisualWebEffects is offline   Reply With Quote
Old 12-19-2009, 09:46 PM   #5
Active Warrior
War Room Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 21
Thanked 4 Times in 3 Posts
Default Re: Tables in XHTML

So why do I get from Validator

"document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag"

??

It doesn't like <div> tags? I have never had that problem before, with HTML - is it an XHTML thing?

Side note -- what code is best for aligning images? I am using <img align ="center"> Which works on every browser except IE.. What would work in IE?

EDIT: I didn't put in the URL because I am stupid :P But it seems to extend throughout the document -- so I thought it just might have been that you can not use <div> in XHTML or something. Obviously not

URL -- www.thetwittertrade.com

I am just spinning because I am getting so many different results from browsers that it is hard to know what I am doing wrong and hard to know what is right. One browser will have a problem - so I will change it and it will be fixed but, fixing it will cause a problem on another broswer.

Anyway -- the code is messy as all hell atm and I am sorry for that

Thanks

JR
JRecard is offline   Reply With Quote
Old 12-19-2009, 10:04 PM   #6
Senior Warrior Member
War Room Member
 
Karen Blundell's Avatar
 
Join Date: Jul 2008
Location: Niagara Region, Canada
Posts: 1,113
Thanks: 1,476
Thanked 412 Times in 322 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Karen Blundell
Default Re: Tables in XHTML

post a URL..without looking at the code, we can only guess..if we see the code we can answer correctly

Karen Blundell is offline   Reply With Quote
Old 12-19-2009, 10:28 PM   #7
Active Warrior
War Room Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 21
Thanked 4 Times in 3 Posts
Default Re: Tables in XHTML

Updated...

Thanks Karen
JRecard is offline   Reply With Quote
Old 12-20-2009, 11:13 AM   #8
HyperActive Warrior
War Room Member
 
VisualWebEffects's Avatar
 
Join Date: Sep 2009
Location: Canada
Posts: 137
Thanks: 4
Thanked 35 Times in 18 Posts
Contact Info
Send a message via Skype™ to VisualWebEffects
Default Re: Tables in XHTML

i took a quick look at the url in your previous post. And i do me quick, and the one thing that hit me about the html is the fact that your using inline style sheets on about 95% of all your html elements.

While inline styles are still supported, it is better design to put them in an external style sheet file (IE: styles.css). Then implement them using the class (IE .mystyle) or ID methods (IE: #mystyle). This way you can reduce your HTML Code overhead by combining styles that our the exact same.

VisualWebEffects- Web Application Development, PC Software Development and Identity Design services
VisualWebEffects is offline   Reply With Quote
Old 12-20-2009, 01:41 PM   #9
Active Warrior
War Room Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 21
Thanked 4 Times in 3 Posts
Default Re: Tables in XHTML

I did actually start doing that today

Your code which you gave me in the first post inspired me to start doing it...

Which BTW worked AWESOME

Thank you very much -- I have fixed most of the problems now, just need to change a couple more inline styles to external.

Thanks again VisualWebEffects -- really appreciate it
JRecard is offline   Reply With Quote
Old 12-20-2009, 03:12 PM   #10
HyperActive Warrior
War Room Member
 
VisualWebEffects's Avatar
 
Join Date: Sep 2009
Location: Canada
Posts: 137
Thanks: 4
Thanked 35 Times in 18 Posts
Contact Info
Send a message via Skype™ to VisualWebEffects
Default Re: Tables in XHTML

no problem. glad i could be of assistance

VisualWebEffects- Web Application Development, PC Software Development and Identity Design services
VisualWebEffects is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
tables, xhtml

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 07:55 PM.