When creating a calendar using tables, how do you move the days forward/backward

Learn / Forums / General InDesign Topics / When creating a calendar using tables, how do you move the days forward/backward

Viewing 9 reply threads
  • Author
    Posts
    • #75525
      Elle Y
      Member

      Hi!
      Am trying to create calendar months by using tables, instead of just tabbing the days forward in a text box. Question is, when I want to move the 1st of the month foward or backwards in the cells, how I do that instead of retyping all over again?

      Thanks!

    • #75526

      If you haven’t gotten too far into it:
      https://calendarwizard.sourceforge.net/
      Everything has Styles, which makes it easy to customize.

      Otherwise, I used to copy/paste cells, then copy entire tables for months that start on the same day (adjust the last days).

      You can still do the Tab thing, and Table->Convert Text to Table (or Table to Text)

      Or maybe someone will have a better idea after me….

    • #75528

      Shifting table contents globally ‘left’ and ‘right’ into previous and next rows, is not a usual table task. If a table column is not aligned correctly with another, you can copy-and-paste the wrong content one position to the left or right. But that won’t work with ‘row wrap’.

      Fortunately, it can be scripted. Here are shiftup.jsx and shiftdown.jsx. They move the *text content* of a table one cell left or right – unless there is something in the first (or last) cell, of course!

      //DESCRIPTION:Shift table cells 'up'
      // A Jongware Script 21-May-2015
      currTable = app.selection[0];
      if (currTable.hasOwnProperty('baseline'))
      	currTable= app.selection[0].parent;
      while (currTable instanceof Cell || currTable instanceof Row || currTable instanceof Column)
      	currTable = currTable.parent;
      if (currTable instanceof Table)
      {
      	if (currTable.cells[0].texts[0] &&
      		currTable.cells[0].texts[0].length > 0)
      	{
      		alert ("no room to shift up!");
      	} else
      	{
      		for (i=1; i<currTable.cells.length; i++)
      			currTable.cells[i].texts[0].move (LocationOptions.AT_BEGINNING, currTable.cells[i-1]);
      	}
      } else
      {
      	alert ("please make sure the cursor is inside a table!");
      }
      

      and

      //DESCRIPTION:Shift table cells 'down'
      // A Jongware Script 21-May-2015
      currTable = app.selection[0];
      if (currTable.hasOwnProperty('baseline'))
      	currTable= app.selection[0].parent;
      while (currTable instanceof Cell || currTable instanceof Row || currTable instanceof Column)
      	currTable = currTable.parent;
      if (currTable instanceof Table)
      {
      	if (currTable.cells[-1].texts[0] &&
      		currTable.cells[-1].texts[0].length > 0)
      	{
      		alert ("no room to shift down!");
      	} else
      	{
      		for (i=currTable.cells.length-2; i>=0; i--)
      			currTable.cells[i].texts[0].move (LocationOptions.AT_BEGINNING, currTable.cells[i+1]);
      	}
      } else
      {
      	alert ("please make sure the cursor is inside a table!");
      }
    • #75529
      Elle Y
      Member

      Thanks for all your speedy replies!

      Colleen, I had come across that option before, but I thought it was a tad too complicated for me to customise; I need very varied options with cell colours, lines, spacing, text formatting etc and am more familiar with the usual style sheets. But yes, should I wanna explore that, it’s a great option! Thanks.

    • #75530
      Elle Y
      Member

      Thanks very much for the scripts Jongware! Am going to explore them.
      Am not very script savvy, so I’ll definitely give a shout I wasn’t quite successful in converting them to documents.
      Fingers crossed.
      Will update!

    • #75531
      Elle Y
      Member

      Ahhh! Thanks Jongware! The scrips are fantastic! Exactly what I wanted. Thank you very much!

    • #75532
      David Blatner
      Keymaster

      That’s an awesome script, Jongware.
      But for most people who want to make calendars, I like Colleen’s suggestion, which we explore in details here:
      https://creativepro.com/calendar-template-time.php
      and
      https://creativepro.com/make-a-calendar-with-every-interfaith-holiday-listed-on-it.php

    • #75553
      Masood Ahmad
      Participant

      Jongware, that was a great script. I love the way you share your talent and experience with others. Thanks.

    • #75567
      Eugene Tyson
      Member

      I just insert an empty return, set the leading to 0.

      Then I use automatic numbering in the paragraph style.

      Style to suit.

      Copy one cell

      Select all cells

      Paste

      Delete text from cells until you’re at the start day where it’s 1.

      And remove excess days at the end.

    • #82323
      G Imh
      Member

      Jongware, is there a way this script can be revised so that instead of moving contents of a cell left or right, it moves that content up or down in a table?

      Thanks.

Viewing 9 reply threads
  • You must be logged in to reply to this topic.
>