...

View Full Version : <table> --> <div>



Canon820
10-18-2004, 10:24 PM
How could I turn this:

<table width="648" border="1" align="center" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF">

Into:
<div id="hello">

Could you show me hot to make all the crap in that table into CSS so I can put it in a sytlesheet. I'm trying to make my site entirely DIVs.

Roy Sinclair
10-18-2004, 10:30 PM
Is the table used for layout purposes or do you have actual data in it? If it's layout then yes, you should replace it but if it's data then the table should remain though it would be proper to replace the table's presentational properties with CSS.

Canon820
10-18-2004, 10:45 PM
It is a layour thing. I just want to know what to put into the CSS in replace of:

width="648" border="1" align="center" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF"

gsnedders
10-18-2004, 10:47 PM
width:648px;
border: 1px solid #ffffff;
margin: 0 0 0 0;
padding: 0 0 0 0;

ronaldb66
10-19-2004, 08:54 AM
There's a lot more to converting a table-based layout to a CSS-P based layout then just replacing the table by a div; without any information about what's inside the table, and what the layout of your page should look like, it is rather pointless to try to cough up some style rules just based on the table attributes.

By the way, Geoffrey: those rules only apply to the table element, not to the table cells inside it; you'll need some more for that... ;) Width works, though! :D

gsnedders
10-19-2004, 06:03 PM
By the way, Geoffrey: those rules only apply to the table element, not to the table cells inside it; you'll need some more for that... ;) Width works, though! :Dand people ask me why I don't like tables :p

Here's the code from my site for a table (which is used for tabular content ;)):
table.championships {
width:97.3333333em;
border-right:1px dashed #000000;
border-bottom:1px dashed #000000;
}

td.championshipsname, th.championshipsname {
width: 17.3333333em;
border-left:1px dashed #000000;
border-top:1px dashed #000000;
padding: 2px 4px 1px 4px;
margin: 0 0 0 0;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum