I presume you've considered creating different templates specific to the presentation/output required and deemed it not appropriate (e.g. presents more options than necessary to an editor/to manage).
Is there any way to do this in the component template or page template? - Read it = Yes, Write = Not without a changing a specific setting that's there to stop Page/Component Templates updating the state of content.
What do you mean by "store data with the page template code"? - I presume you mean trying to have this embedded into the Template script - which I would not recommend, the Page Template should be used to generate the necessary output for the page and not to input data back into the system.
I guess you could use the Event System (Page>OnSave) to push app data into, say, the Component(1) that would contain a field pertaining the to the specific instance of Component AND Component Template AND Page IDs (assuming the same presentation won't be used on the same page with a different column value).
Then, when writing your output, you can catch the AppData and add the necessary syntax to denote columns for that instance of a Component Presentation (be that in the Page of Component Template - depending on how you have to write this out etc.)
Update
Just reviewing this and thought it worth adding the SDL Idea (and I'm sure someone did an extension) of having specific fields that apply to an instance of a CP - sounds like this would actually be a good fit
(1) you could equally use the Page but it may be useful to hold it in the Component in the event you want to report on total usage of that asset - which would mean only opening a single item, the Component, as opposed to looking at where it's used