# Creating tables with variable number of columns

**URL:** <https://www.ruby-forum.com/t/creating-tables-with-variable-number-of-columns/132112>\
**Category:** Rails\
**Created:** [March 17, 2008, 5:11am UTC](https://www.ruby-forum.com/t/creating-tables-with-variable-number-of-columns/132112 "2008-03-17T05:11:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 17, 2008, 5:11am UTC](https://www.ruby-forum.com/t/creating-tables-with-variable-number-of-columns/132112/1 "2008-03-17T05:11:45Z")

</div>

to put this question as simply as possible…

- spreadsheet functionality without a spreadsheet -

ive tried a few different approaches to this problem without  
success… giving the user a way to create tables to store trivial  
information in tabular format. each table would generally have a  
different number of columns…

the last approach i tried involved having a sheet, sheetrow,  
sheetcolumn, sheetfield… sheet having many rows and columns, field  
belonging to row and column… etc… whatever - as you can tell this  
is a complication from hell and unlikely to be in any way shape or  
form efficient…

so any ideas?

thanks,

- FJM

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 17, 2008, 5:17am UTC](https://www.ruby-forum.com/t/creating-tables-with-variable-number-of-columns/132112/2 "2008-03-17T05:17:01Z")

</div>

On Mar 16, 2008, at 9:10 PM, removed\_email\_address@domain.invalid wrote:

> - spreadsheet functionality without a spreadsheet -

Have a look at:

[http://code.google.com/p/trimpath/wiki/TrimSpreadsheet](http://code.google.com/p/trimpath/wiki/TrimSpreadsheet)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 18, 2008, 7:22am UTC](https://www.ruby-forum.com/t/creating-tables-with-variable-number-of-columns/132112/3 "2008-03-18T07:22:26Z")

</div>

yeah, i guess a main stumbling block is going to be keeping all the  
data separate. i don’t want to just store my stuff as a serialized  
object … eh, i guess im going to be trying to reinvent the wheel in  
some ways but i can’t really find another decent way… many thanks  
though.
