Forum Moderators: not2easy

Message Too Old, No Replies

Overwriting css

changing table width

         

tomda

2:12 pm on Apr 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If my stylesheet (CSS file), I have
table {border:0 none; border-collapse:collapse; width:765px; }

When I type the following lines after loading the css

table {border:0 none; border-collapse:collapse; width:65px;}
It works great and all table are reduced.

BUT when I type

table {border:0 none; border-collapse:collapse;}
It doesn't give me what I want, it follows the width given in the CSS (765px). I presume it is a question of CSS priority.

Then, what should I do to cancel the default width from my CSS so that I can play around with table without making a new CSS file?

createErrorMsg

2:38 pm on Apr 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the width is set in the external stylesheet, it will persist unless explicitly overridden with a new width setting. To get it back to default, set width:auto;. If you want it a different width, just set it to the new width.

cEM

tomda

2:54 pm on Apr 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your quick response cEM.

Indeed, setting it to "auto" works...

Thanks

In fact, the problem I had was due to a javascript newsfeeder starting with <table>. This table was taking the all width of my page because table were set to 765px by default in my external css.