mickeymouse Posted December 31, 2019 Share Posted December 31, 2019 I'm not getting a frame and I'm not getting a width of 40% but a very large width wider than my screen. Why? <table style='cellpadding:10; cellspacing:0; align:center; width:40%; frame:box; border:1; bordercolor:Blue'; background-color:lavendure' > Same thing with <table cellpadding:10; cellspacing:0; align:center; width:40%; frame:box; border:1; bordercolor:Blue; background-color:lavendure > Link to comment Share on other sites More sharing options...
dsonesuk Posted December 31, 2019 Share Posted December 31, 2019 cellpadding and cellspacing are not css, they are table element attributes. In CSS, padding is equivalent to cellpadding and border-spacing: is equivalent to cellspacing. bordercolor must have hyphen after border as in border-color. You also have misplaced single quote after the border-color value, so again it will wrongly interpret what you want. Link to comment Share on other sites More sharing options...
mickeymouse Posted January 1, 2020 Author Share Posted January 1, 2020 I've corrected the error(s) and put everything as Table attributes and so I get the correct results except for the width - it doesn't work. I just can't understand why not and can't see anything wrong with my attribute spec. I use the same thing in other pages and it works fine. <table cellpadding='10' cellspacing='0' frame='box' width='40%' border='1px'; border-color='Blue' background-color='lavendure' align='center'> P.S. All the best to you in 2020! Link to comment Share on other sites More sharing options...
dsonesuk Posted January 1, 2020 Share Posted January 1, 2020 Now you are turning css into invalid attributes? The only valid attributes are cellpadding, cellspacing and width, the border would also valid if it didn't include unit 'px'. The rest are CSS and should not use a equals sign but instead a colon : and no quotes, the only quotes used are with style attribute which the css is placed within. Note: frame="box" is obsolete Link to comment Share on other sites More sharing options...
mickeymouse Posted January 2, 2020 Author Share Posted January 2, 2020 Thanks. I made the corrections and all is OK now. However, if frame="box" is obsolete, how do I get a box? Link to comment Share on other sites More sharing options...
dsonesuk Posted January 2, 2020 Share Posted January 2, 2020 The CSS border properties you are using will give equivalent of frame="box" You require border-width: 1px;, border-style: solid; and border-color: blue; OR shorthand equivalent border: 1px solid blue; 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