Jump to content

CSS Style Tables


mentalist

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/210636-css-style-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.