Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table side by side

Status
Not open for further replies.

786snow

Programmer
Nov 12, 2006
75
Hi,

When I have the tables like below and the align=center they come top/bottom and that how I wanted but I when I change the align to left they come side by side instead of top bottom. How can I do it top / bottom when alignment is left

Code:
<html>
<body>


<table cellpadding=0 cellspacing=2 border=0 width=100%  align=left> 
<tr> 
<td  bgcolor=red><b>For Web Users:</b></td> 
</tr> 
</table

<table cellpadding=0 cellspacing=2 border=0 width=100%  align=left> 
<tr> 
<td  bgcolor=red><b>For App Users:</b></td> 
</tr> 
</table>

</body>
</html>
 
Just remove align=left entirely. Align is a deprecated attribute anyway and aligning it left or right actually floats the table left or right, while aligning it to centre sets its left and right margins to auto. By default, unless specified differently though, tables will align to the left.
 
thanks a lot, it worked like u said
 
one mode thing

is it ok to mix with tables and <p> out side table and some time just straight text not even in <p> tag, do you see anything wrong like the following

Code:
<html>
<body>

<p> My name is Ken</p>
<br>
<b>yes this is my name</b>

<table cellpadding=0 cellspacing=2 border=0 width=100%  align=left> 
<tr> 

<td  bgcolor=red><b>For Web Users:</b></td> 
</tr> 
</table

<table cellpadding=0 cellspacing=2 border=0 width=100%  align=left> 
<tr> 
<td  bgcolor=red><b>For App Users:</b></td> 
</tr> 
</table>

</body>
</html>
[code]
 
do you see anything wrong
I guess it depends on the answer you are looking for. For example, the code you posted is using:

* tables for layout
* depreciated attributes and elements
* no DOCTYPE is specified
* there are no quotes around any attribute
* isn't using CSS for styling.

Personally, I'd say there was a lot wrong with the code you posted.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Maybe, maybe not.

As it seems the poster is just starting out on a project, I think it's a good chance for them to start learning some good practices and using them. I know lots of people here see the advantages of CSS, semantic markup etc but not everyone does as is proven by this post. Hopefully, if the poster can learn the "proper" way of doing things, it will save them hours of pain later!


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top