_tech_dude_ Posted September 24, 2006 Share Posted September 24, 2006 My problem is this:How do i (using either css or html) close the gap between table cells and/or table elements. my (very crude) picture shows 4 table cells. table 1 has cells 1 and 2, and table two has cells 3 and 4. how do i close or control the gap width between them? Link to comment Share on other sites More sharing options...
Ruud Hermans Posted September 25, 2006 Share Posted September 25, 2006 You need to set cellspacing to 0 like in the example. <TABLE CELLSPACING=0> Ruud Hermans. Link to comment Share on other sites More sharing options...
_tech_dude_ Posted September 25, 2006 Author Share Posted September 25, 2006 cheers for that ruud. ok new problem - how to align the table centrally? the <center>tag is deprecated, and the only center align attribute i can find in css is for text... Link to comment Share on other sites More sharing options...
skym Posted September 25, 2006 Share Posted September 25, 2006 There would also be <div align="center"> ... </div> Not sure if it's deprecated this too... Probably it is. Link to comment Share on other sites More sharing options...
jesh Posted September 25, 2006 Share Posted September 25, 2006 You might try setting the left and right margins of the table to "auto" with CSS. If you wanted your table width to be 60% of the containing element and you wanted it centered, you could do something like: <div id="theContainingElement"> <table style="margin: 0px auto; width: 60%;" cellspacing="0"> ... </table></div> Link to comment Share on other sites More sharing options...
holmedwa04 Posted September 25, 2006 Share Posted September 25, 2006 Why is the center tag depriciated, I still use it and always will! Link to comment Share on other sites More sharing options...
Ruud Hermans Posted September 25, 2006 Share Posted September 25, 2006 To center the entire table you can add the following to it's code: <TABLE ALIGN="CENTER"> If you want the text to be aligned you can do this in the following way: <TD ALIGN="CENTER">Content</CENTER> These things can also be achieved without the use of .CSS, if you prefer to use .CSS I would suggest you learn it before you start using it in case you get stucked ore something goes wrong.Ruud Hermans. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 25, 2006 Share Posted September 25, 2006 Why is the center tag depriciated, I still use it and always will!You can do whatever you want, but don't expect your documents to always work. DeprecatedA deprecated element or attribute is one that has been outdated by newer constructs. Deprecated elements are defined in the reference manual in appropriate locations, but are clearly marked as deprecated. Deprecated elements may become obsolete in future versions of HTML. User agents should continue to support deprecated elements for reasons of backward compatibility.Definitions of elements and attributes clearly indicate which are deprecated.This specification includes examples that illustrate how to avoid using deprecated elements. In most cases these depend on user agent support for style sheets. In general, authors should use style sheets to achieve stylistic and formatting effects rather than HTML presentational attributes. HTML presentational attributes have been deprecated when style sheet alternatives exist (see, for example, [CSS1]).ObsoleteAn obsolete element or attribute is one for which there is no guarantee of support by a user agent. Obsolete elements are no longer defined in the specification, but are listed for historical purposes in the changes section of the reference manual.The point is to separate structure from presentation. Structure goes in the HTML document, and presentation goes in the CSS document. You can use whatever deprecated things you want, but be aware that at some point they will become obsolete and browsers may just stop supporting them. Some doctypes already do not support them. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now