This sentence is the start of a new paragraph. The ellipses are as written:
...てなわけで、まる子は、カブトムシの幼虫を廊下のすみに置いたプラスチックの水槽で飼っていたのだったが...。それから一か月。
??? Maruko was raising the Rhinoceros Beetle grubs in a plastic fish tank that she'd put in the corner of the hallway, but... . A month went by.
I don't understand what てなわけで means. I read this question, but was unenlightened since I can't understand というわけで either.
My guess is that the わけ part together with the のだった part later on suggest that the narrator is explaining the reason for something. Later sentences got on to say that she forget to look after them for a month.