Html Help!!!

liunx

Guest
Look at this SITE!!! (<!-- m --><a class="postlink" href="http://www.forumstyles.com/ztp">http://www.forumstyles.com/ztp</a><!-- m -->) It has sort of like a table in the middle! How do u add thoses?<!--content-->welcome to the forums :)<br />
<br />
please see this (<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=28777">http://www.htmlforums.com/showthread.ph ... adid=28777</a><!-- m -->) thread<!--content-->Whoa man, that is far to complicated! Could u tell me like where to add the codes and tuff. But please with an easy approach, I'm new to HTML!<!--content-->hehe, sorry bout that,<br />
<br />
<div style="width:100%;text-align:center;"><br />
<div style="margin:0px auto;"><br />
<br />
place all your pages content/coding here<br />
<br />
</div><br />
</div><br />
<br />
<br />
place your pages coding where it says to, the coding above and below it will center it for you.:)<!--content-->as i stated in that thread, that will only center block elements in IE, unless mozilla has changed it since the last time i tried it, it wont work in mozilla/netscape. if you want the table to be centered, add align="center" in the table tag, or if you are centering divs and using xhtml, you define the width of the div and add margin: auto to the div style, OR you can also define the width and position it absolutely so that its left: 50%; margin-left: -halfofthedivswidth;<!--content-->I'm not positive, but I think he's actually wanting to know how to make the table.<br />
<br />
<br />
<table> //starts table<br />
<tr> //begins a table row (row1)<br />
<td>"put info here"</td> //begins and ends a cell<br />
<td>Put more info here</td> //begins/ends another cell<br />
</tr> //ends table row (row1)<br />
<tr> //begins table row (row2)<br />
<td>"put info here"</td> //begins and ends a cell<br />
<td>Put more info here</td> //begins/ends another cell<br />
</tr> //ends table row 9row2)<br />
</table> //closes table<br />
<br />
<br />
that will make a table that is 2 columns and 2 rows. To make it one column (like the one on that site) remove one of the TD sets from each TR tag.<br />
<br />
hth<br />
Aaron<!--content-->Ok turned out that this is the code I needed<br />
<br />
<table border="?" align="center" cellspacing="?" cellpadding="?"><br />
<tr><td><br />
Whatever you want here.<br />
</td></tr><br />
</table><br />
<br />
? being the correct size!<br />
But how can I change the boarders colour/style and how can I change the background colour for the actuall table?<!--content-->Originally posted by leoo24 <br />
<br />
<br />
<div style="width:100%;text-align:center;"><br />
<div style="margin:0px auto;"><br />
<br />
place all your pages content/coding here<br />
<br />
</div><br />
</div><br />
<br />
<br />
read it again n8, it's the same as i posted in that other thread and does center in mozilla, but you are correct that text-align:center; by itself does not work in mozilla.<br />
<br />
ok, bigcatkeeper, 'align' is deprecated (may work now but in future browsers it will not)use the method i gave.<br />
Borders and backgrounds in css add this to either the entire table or a cell individually:<br />
<br />
<table style="border:1px solid #000000;background:#ffffff;"><br />
<br />
or just to one cell:<br />
<td style="border:1px solid #000000;background:#ffffff;"><br />
<br />
change the values to your needs, border style (in this case i used solid) can be one of:<br />
dotted<br />
dashed<br />
solid<br />
double<br />
groove<br />
ridge<br />
inset<br />
outset <br />
<br />
#000000 is the hex value for black, visit <br />
here (<!-- m --><a class="postlink" href="http://www.visibone.com/colorlab/">http://www.visibone.com/colorlab/</a><!-- m -->) to get the hex value for the color you want.<br />
<br />
cellspacing is the spacing between each cell, and cell padding the spacing around elements within a cell, you choose, have a play around.<!--content-->On the code I posted where would I add <table style="border:1px solid #000000;background:#ffffff;"><!--content-->ahhh sorry, didnt see the auto, but if you have the auto, you dont need the div with text-align: center, it should work fine without it if you have an xhtml doctype<!--content-->doing it that way gets over a bug in certain versions of ie :)<br />
<br />
<table border="0" cellspacing="0" cellpadding="0" style="border:1px solid #000000;background:#ffffff;"><br />
<br />
this is called inline style :)<!--content--><td>Always ensure that table data is on the same line as the tags</td><br />
<br />
<br />
Inline CSS is OK, but if you start having to use the same styles over and over then the styles should be put into a separate stylesheet and referenced by using class names. This decreses the file sizes, allows far easier editing of style information, and allows the whole site to use just one short style file for everything.<!--content-->i only use inline style here to make it easier for people decifering it to understand and learn it, it's easy to later throw it and start designing it through external syles and class's/id's<!--content-->
 
Back
Top