SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Can I nowrap my date generator?

    Hi all -

    I seem to be having difficulty on one page getting my date generator to all stay on one line.

    Yes, it's in a table, and for this page I don't have any graphics or such to keep the column open wide enough.
    I tried <td valign="top" bgcolor="3399FF" width="125"> but it doesn't seem to do anything, so I thought I'd try a nowrap, but I have never had need of it before.

    Thanks!

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You mean how to use nowrap? Place nowrap="nowrap" in your td tag. If not, let us know the code of the whole table, maybe that helps.

  3. #3
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul -

    I tried that and it still doesn't work. I an feeling defective.

    Here is the code from the beginning of the table to the bottom of the first column...

    <!-- Begin Main Table -->
    <center>
    <table width="800" cellspacing="5" cellpadding="5">
    <tr>
    <!-- Begin Left Column -->
    <td valign="top" bgcolor="3399FF" width="125" "nowrap">
    <P></P>
    <!-- Begin Date Generator -->

    <strong><font face="maiandra gd, Verdana, Arial, sans-serif" size="2" color="ffff0f">
    <script language="JavaScript">
    <!-- Begin
    var months=new Array(13);
    months[1]="January";
    months[2]="February";
    months[3]="March";
    months[4]="April";
    months[5]="May";
    months[6]="June";
    months[7]="July";
    months[8]="August";
    months[9]="September";
    months[10]="October";
    months[11]="November";
    months[12]="December";
    var time=new Date();
    var lmonth=months[time.getMonth() + 1];
    var date=time.getDate();
    var year=time.getYear();
    if (year < 2000) // Y2K Fix, Isaac Powell
    year = year + 1900;
    document.write("<center>" + lmonth + " ");
    document.write(date + ", " + year + "</center>");
    // End -->
    </script>
    </font>
    <p>
    </P>

    <!-- End Date Generator -->

    </td>



  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I copy this code, the date is displayed just fine, on one line. How does it look like at your pc? And also, why do you have empty paragraph (p) tags in the table?

  5. #5
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Darn, you caught me being lazy! I felt so guilty that I &nbsp;'d them before I even replied!

    I swear that the rest ARE &nbsp 'd!

    As far as the nowrap goes, it really isn't showing up in my 1st Page 2000 editor. Maybe the problem lies with it, but it usually is pretty accurate.

  6. #6
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using the following html, I get the date on one line with the padding as you wanted it. I moved the css into the head of the document by using a style .timecell and applying it to the cell where the time is being called.

    Not sure that nowrap works cross browser either, I put the width in the style .. and it works for me

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    .timecell {
    font: 12px bold maiandra gd, Verdana, Arial, sans-serif;
    color: ffff0f;
    width: 125px;
    padding: 5px;
    }
    -->
    </style>
    </head>

    <body>
    <!-- Begin Main Table -->
    <center>
    <table width="800" cellspacing="5" cellpadding="5">
    <tr>
    <!-- Begin Left Column -->
    <td valign="top" bgcolor="3399FF" class="timecell">
    <!-- Begin Date Generator -->
    <script language="JavaScript">
    <!-- Begin
    var months=new Array(13);
    months[1]="January";
    months[2]="February";
    months[3]="March";
    months[4]="April";
    months[5]="May";
    months[6]="June";
    months[7]="July";
    months[8]="August";
    months[9]="September";
    months[10]="October";
    months[11]="November";
    months[12]="December";
    var time=new Date();
    var lmonth=months[time.getMonth() + 1];
    var date=time.getDate();
    var year=time.getYear();
    if (year < 2000) // Y2K Fix, Isaac Powell
    year = year + 1900;
    document.write("<center>" + lmonth + " ");
    document.write(date + ", " + year + "</center>");
    // End -->
    </script></font>
    <!-- End Date Generator -->
    </td>
    <td> 2nd column content here</td>
    </tr>
    </body>
    </html>


    Nadia

  7. #7
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Thanks Nadia -

    And one more thing moved into my little CSS script!

    One more question from such a CSS newbie. Since I am still stuck with tables, I guess I have to nest a table in to the existing one since the <TD> tag has a class call in it. Is that right?

    Usually I have a whole bunch of other things in that column, which is why I never noticed that wrapping problem before.

    I would really love to get as much a spossible put into the CSS so that I can mess with my whole site at once! Some pages haven't been updated in months because I am still tweaking the basics.

  8. #8
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends on your layout and if the rest of the cell is going to have the same background color. You can always just add another cell below the first and give it a different style. Is this cell your navigation column?
    If it is you may also need to nest a table inside the column next to it, so that your navbar table doesn't stretch vertically as you add content to the right column.

    I have a small tut of nested table here and why you should use it: http://dreamweaverresources.com/tuto...stedtables.htm

    Without seeing your actual page, it is a little difficult to give you more info :-)

    Glad the html I supplied worked for you. PS: nothing wrong with using tables either, just make sure you use a lot of css for styling. Keep using tables until you are more comfortable with using css for positioning :-D

    Nadia

  9. #9
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Nadia -

    Thank you!!!!

    I see everyone getting beaten up over tables, but I can't see how to make the layout I have chosen to work without them.

    My website is UrbanFirefly.
    Just please be aware that I am still working things out, so not all pages have been worked on in awhile, and they don't match from page to page.

    I have several big questions pending in other forum areas...

    I will try uploading the newsletter page with your script. It should be in about 15 minutes. BEWARE that the box links in the left column of many pages is NOT the right one!! That is a freebie CafePress link that I am removing! They don't let you see any stats or emails or anything except the # of subscribers you have!

    Nina

  10. #10
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, It doesn't look right in 1st page, but I will upload it and see...

    BTW - the page with this script on it will be urbanfirefly.com/newsletter.html

  11. #11
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Won't have time to look at this again until much later tonight/tomorrow - hopefully I can give you some feedback later. Too much client work to complete :-D

    Nadia

  12. #12
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An update...

    I have uploaded it, and it is still wrapped at least in Firefox...

    You can check it out at Newsletter.

    This question is related to two other of my questions, which may help to either clarify or confuse all of you helpers...

    Newsletter help

    Page size help The test link for that one is Newsletter2
    .


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •