Fat-Bottomed Girl (dorkdance) wrote in component_help,
Fat-Bottomed Girl

  • Music:

Minor Tweak: Centering the YearPage table in Firefox?

I'm attempting to revamp my calendar view to the point that it actually looks good in my current layout. As a result, I've put it inside a content box that's inside a system box, but that part's all set.

In function YearPage I'm trying to get the table that holds the individual month tables, centered. However, no matter how many align="center"s, <center>s, and style="align: center;"s I slap on the sucker, it refuses to budge in Firefox. [It looks good in IE, which tells me that something is probably wrong with my coding.] Is the table just destined to sit stubbornly in one place in Firefox, or is there something I can do, short of beating it with a blunt object of some sort, to make it work?

The coding for the function is below.


function YearPage::print_body {
	var bool toggle = false;
	"""<table cellspacing="0" cellpadding="0" border="0" width="100%">
	<tr align="center">
	<td valign="top" align="center">""";

	"\n			<center><table cellspacing=\"3\" cellpadding=\"3\" border=\"0\" style=\"margin-left: 0px; margin-top: 0px; align: center;\"  align=\"center\">\n				<tr align=\"center\">";
    foreach var YearMonth m ($.months) {
	    if ($m.has_entries) {
			"\n					<td valign=\"top\">";
			"\n					</td>";
			if($toggle) {
				"\n				</tr><tr>";
				$toggle = false;
			} else {
				$toggle = true;
	"\n				</tr>\n			</table>";


You'll note the very centered table in the IE screencap, on the left, and the very not centered table in the Firefox screencap, on the right. Just, you know, because visual aids are fun.

[ETA] Fixed! Thank you, uniquewonders!

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened