Create custom class from existing item?

I’m sure this is documented somewhere, but I can’t find it. I have an existing table with styling (color, image, etc), and I’d like to create a custom class so I can replicate that styling elsewhere - without creating a class for it from scratch.

Is that possible?

You can select the class you want in the class editor panel and right click to copy, then right click to paste on the second table, which will carry over the settings. You could also just start to type in the letters of the class you want inside the class editor and it should appear as an option you can select.

N.B If you make changes to the class in the second table that will automatically feed back to the first table, since classes are global. If you want to make changes without affecting the original it is better to open the class manager, find the class and duplicate it with a different name, then edit. You could basically have similar, yet unique classes with names like table-1, table-2 etc.

1 Like

And if you want to move it to a new Blocs file just save it in the Class library.

1 Like

I guess you have that table on a non-blocs project site?

1 Like

If I understand this correctly, you have customised some elements of your table using the properties panel and now want to create a class based on that customisation?

I don’t think you can do that and it shouldn’t be that hard to create a class with those characteristics using the class editor.

In general it’s best practice to use classes at the start to customise appearance rather than the properties panel if you wish to get a consistent look and feel throughout your web project.

1 Like

OK - thanks everyone!

A follow-up - actually what I’m trying to do is use an accordion container to collapse a long table of inforrmation for smaller breakpoints. But, the table I’ve created for larger breakpoints has some nice background images and colors. I’d like to keep that same look inside the accordion, but I can’t find a way to do that.

I thought applying a class to the accordion would do it, but that doesn’t seem to work.

My challenge in general is that I’m recreating a site with a ton of detailed historical records - mostly long tables with links to pictures, maps, others sites, etc - and struggling to find ways to present that dense content in a modern format. The old website I hand-coded HTML way back when HTML 4 was brand new. It’s a tad dated now. :slight_smile:

Any change you got it live somewhere to understand better? :thinking:

Only if you promise not to laugh.

It’s a railroad history site, and is meant to dig deeply into the details of this old railroad. A lot of people build models or research the history of this area, and actually I have a quite a few people using my site as a reference for numerous details about it.

But, my site is way outdated; until now I just haven/t had the time to undertake a full rebuild, mostly because the content is so dense.

If you dig into the site a bit, you’ll find a mile-by-mile reference of the railroad, and an exploration guide, and tables of other details - timelines, paper records, remaining equipment, etc.

Right now I’m playing with recreating this page, mostly to explore what’s possible:

No Laughing here, just hats off! :pray:
I love trains! At the age of 7-13 I had hanging above my bed (!) a 2.4m x 1.2m board with a railway track including mountains, a station and all I can’t remember. I started with Marklin but changed later for Lego when they came out with their range of trains—holding it all up with pulleys! :thinking: Thank god for this thing never came down when I was sleeping. :smile: Those were the days which don’t exist anymore!

Back to your project. You would need a table(s) inside Blocs. Today you 3 options:

  1. To use Google sheets. You just add to your Blocs file a code widget and add the code of the spreadsheet to Blocs. I’ve never used it myself but @AdieJAM is a heavy Google user so he might be able to explain more in detail.

  2. @Malachiman created a video a while ago on how to create tables within Blocs. It needs a bit of manual coding but following the steps in the video, it’s fairly easy to implement. You can find the video here: Blocs - Creating a Table with Divs and minimal CSS - YouTube

  3. The developer of Blocs released a table Bric a while ago but it got pulled back. You can download the Table Bric still here: Blocs 4.3 Beta Build 1
    I had never had any issues with the Table Bric but that’s no guarantee for the future. There must be a valid reason why it got pulled back.

You’ve taken yourself on a mission. Looking forward to seeing the outcome!

1 Like

I’d say mainly ditch the tables (where you can), which although are possible, are not the best for a modern responsive site (with some exceptions). And go for an image gallery or cards or something similar. Lots of ways.

1 Like

Hi, @shaworth7. I created a column structure. Let me know if something like this works for you.
I think it’s the first Blocs file created with Blocs for iPad here! :smiley: :champagne: :palm_tree:

train-table.bloc (234.9 KB)


Thanks Jerry - that helps. I still have to wrap my mind around using nested containers, instead of the old HTML table / row / column items. But this really helpful !! Thanks!!

I’ve made a custom bric out of it, just so I can pull in a starting structure w/ alignments as a starting point.