Forum Moderators: not2easy

Message Too Old, No Replies

css table align problem

         

mongoloid001

9:28 pm on Jun 25, 2003 (gmt 0)

10+ Year Member



how come I cannot easily replace <table align="center"> in css?

this


 
table#fire-content{
float:center;
width: 95%;
border: 0;
bordercolor: blue;
bgcolor: #CCCC99;
padding: 1;
}

didn't work; neither did this
 [center]
div {margin-left:auto;margin-right:auto;}
<div>
<table>
</table>
</div> [/center]

What's going on?

Birdman

9:30 pm on Jun 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World, mongoloid001!

Try adding text-align: center;

mongoloid001

10:12 pm on Jun 25, 2003 (gmt 0)

10+ Year Member



oh darn! I was doing it on the wrong/outer table

Thanks! text-align works. I should've more confident on CSS:).

Birdman

10:20 pm on Jun 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are most welcome! CSS is usually a struggle at first, but then it will all seem so obvious that you will never want to use a table again.

Added: Some will argue that CSS isn't ready for prime time, due to lack of older browser support. It depends on your users, if you have a high percentage of users with old browsers, tables are probably better.

Either way, you can still remove all those ugly <font> tags with CSS ;)