maz Posted March 22, 2004 Share Posted March 22, 2004 Hi I am simply trying to put a border around each subcategory image and the subcategory title on the index page. I am editing the index.php file around line 100 This is what I am editing: $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top" ><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; CHANGING TO THIS [CODE] $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <table border="1" width="' . $width . '" cellspacing="0" cellpadding="2"><td align="center" class="smallText" width="' . $width . '" valign="top" ><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; I do get a border around every subcategory image and title, BUT ALL THE SUBCATEGORIES appear VERTICALLY and not side by side horizontally. Spent hours in the forums, but cannot find anything specific. Any advice would be appreciated. Many thanks. Link to comment Share on other sites More sharing options...
maz Posted March 23, 2004 Author Share Posted March 23, 2004 Would appreciate some help on this thanks. Link to comment Share on other sites More sharing options...
Wizzud Posted March 23, 2004 Share Posted March 23, 2004 Your basic HTML is wrong. The active label at the time you enter the changed code segment is <TR>. Within <TR> labels you have one or more <TD> labels. Within a <TD> you can then have a new <TABLE> if you wish. You should probably have something more along the lines of $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top" ><table border="1" cellspacing="0" cellpadding="2"><tr><td align="center" class="smallText" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td></tr></table></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; Whether this will do exactly what you want I don't know, but you can play around with the innnermost <TABLE><TR><TD> parameters. Regards, Wizzud "It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt." Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.