mentalist Posted August 13, 2010 Share Posted August 13, 2010 Here's a code snippet which displays some tabulated data in a number of columns. print "<table width='100%'><tr>\n"; $cols=3; $a=array(array("Title","Info"),array("Title","Info"),array("Title","Info"), array("Title","Info"),array("Title","Info"),array("Title","Info"), array("Title","Info"),array("Title","Info")); foreach($a as $e){ print " <td>\n"; print " <div style='background-color:#efefef;padding:5px;'><b>".$e[0]."</b><br />".$e[1]."</div>\n"; print " </td>\n"; if($n%$cols==$cols-1){ print "</tr><tr>\n"; } $n++; } print "</tr></table>\n"; How would you recreate this without the use of the HTML 'table' tag? Quote Link to comment https://forums.phpfreaks.com/topic/210636-css-style-tables/ Share on other sites More sharing options...
isedeasy Posted August 13, 2010 Share Posted August 13, 2010 Why would you want to? Tables are for displaying tabular data, they do it brilliantly. Quote Link to comment https://forums.phpfreaks.com/topic/210636-css-style-tables/#findComment-1098824 Share on other sites More sharing options...
mentalist Posted August 13, 2010 Author Share Posted August 13, 2010 This is why i'm being slow at moving over. Hey is that my slide-rule over there? Quote Link to comment https://forums.phpfreaks.com/topic/210636-css-style-tables/#findComment-1098828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.