That looks pretty good. I don't really know why would you want to limit your table 17px in height -- height is usually regarded as auto, ie. fill as much as there's content. I would remove the height and leave the width and try it. If it works for you, great, if it doesn't, tell us what didn't work.
To be padantic, the height should have a semicolon. Remember that if you put anything in the table larger than the size you set in the css, the table may render... oddly.
If your just leaving all the CSS in the style attribute of tags, then your gaining nothing by moving over. The whole idea about CSS is seperating content from presentation so that it is easy to change the who presentation without muddling through the content. Moreover, it lets you use one "style" for a whole site not for just a page (or section of a page). Your next big move is define classes, and use them.
if that's your only table then simply use table; otherwise, yes, that is correct syntax WITHIN CSS style code. table attributes can be used w/o classes if you didn't know. for example the following css will apply to any table on the page; therefore you will not have to add class or id = to any of the table attributes you can even assign font/text attributes with each ...this is why css is very useful as a centerpoint for amy page..make one stylesheet and can code hundreds of pages instead of having to maintain hundreds..you maintain 1!
for ex. THIS ONE OBVIOUSLY WILL ONLY AFFECT THIS PAGE...YOU WOULD HAVE TO LINK EXTERNALLY TO A .CSS TO APPLY TO MANY PAGES...FOR DEMO ONLY HERE
<html>
<head>
<style type="text/css">
table{width:100%;height:auto;}
th(width:auto;}
tr(background-color:red;}
td{text-align:left;}
</style>
</head>
<body>
<table cellspacing="0">
<th>thw is auto, tbl is 100%, tbl is auto for 1 row </th>
<tr>
<td>Row will be red</td>
</tr>
</table>
</body>
</html>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.