How can I insert a table into collapsible content on the Dawn theme?

Hey is there any way to insert a table in collapsible content? I have a Dawn theme. For example, I have this information in a metafield and need it to be a table.

1 Like

HI @elektrolt , Where do you want to add collapsible table on your website? also please share your website link so I can check your website.

Best

Rohail Ali

@elektrolt

do you add content in table in product admin content

Hi @elektrolt By default there is no way you can turn this data into the table.

Does your every product has a unique value for this or do multiple products have the same data for this filed?

Hey, every product will have unique values

how many total products are there?

@Ahsan_ANC There will be around 100 products

it’s a tricky one, we will need to add 100 tables to the main-product.liquid file and they will be shown based on the product title.

I have another plane. is your data will be 2 columns and fixed number of rows?

@Ahsan_ANC I am thinking about just making those tables as images and add them as a metafield, but it will take a lot of time to make individual table.. There will be 2 collumns in all tables, but I will need a various number of rows. For example: for product infomation I will need 7 rows, for product measurments 5 rows.

I will need some logic, Can you wait for a day I will create a solution tomorrow? currently, a lot of community users are online to get help.

Sure, no problem, thank you very much! @Ahsan_ANC

Hi @elektrolt please share the main-product.liquid file code so i can update it

{{ 'section-main-product.css' | asset_url | stylesheet_tag }} {{ 'component-accordion.css' | asset_url | stylesheet_tag }} {{ 'component-price.css' | asset_url | stylesheet_tag }} {{ 'component-rte.css' | asset_url | stylesheet_tag }} {{ 'component-slider.css' | asset_url | stylesheet_tag }} {{ 'component-rating.css' | asset_url | stylesheet_tag }} {{ 'component-loading-overlay.css' | asset_url | stylesheet_tag }} {{ 'component-deferred-media.css' | asset_url | stylesheet_tag }}

{%- style -%}
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
}

@media screen and (min-width: 750px) {
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top }}px;
padding-bottom: {{ section.settings.padding_bottom }}px;
}
}
{%- endstyle -%}

{%- assign first_3d_model = product.media | where: “media_type”, “model” | first -%}
{%- if first_3d_model -%}
{{ ‘component-product-model.css’ | asset_url | stylesheet_tag }}

{%- endif -%}
{% if product.images != null %}
{%- for media in product.media -%}
{% if media.media_type == "video" %} {{ media | media_tag: image_size: "720x", autoplay: true, loop: loop, controls: true, preload: "none", autoplay: true, height: "100%", width: "100%" }} {% else %} {{ media.alt | escape }} {% endif %}
{%- endfor -%}
{% if product.images.size > 1 %}
{%- for media in product.media -%}
{{ media.alt | escape }}
{%- endfor -%}
{% endif %} {% else %} {{ 'product-1' | placeholder_svg_tag }} {% endif %}
{%- assign product_form_id = 'product-form-' | append: section.id -%}

{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when ‘@app’ -%}
{% render block %}
{%- when ‘text’ -%}

{{- block.settings.text -}}

{%- when 'title' -%}

{{ product.title | escape }}

{{ product.title | escape }}

{%- when 'price' -%}
{%- render 'price', product: product, use_variant: true, show_badges: true, price_class: 'price--large' -%}
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}
{%- if shop.taxes_included -%} {{ 'products.product.include_taxes' | t }} {%- endif -%} {%- if shop.shipping_policy.body != blank -%} {{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }} {%- endif -%}
{%- endif -%}
{%- assign product_form_installment_id = 'product-form-installment-' | append: section.id -%} {%- form 'product', product, id: product_form_installment_id, class: 'installment caption-large' -%} {{ form | payment_terms }} {%- endform -%}
{%- when 'description' -%} {%- if product.description != blank -%}
{{ product.description }}
{%- endif -%} {%- when 'custom_liquid' -%} {{ block.settings.custom_liquid }} {%- when 'collapsible_tab' -%}
{% render 'icon-accordion', icon: block.settings.icon %}

{{ block.settings.heading | default: block.settings.page.title }}

{% render 'icon-caret' %}
{{ block.settings.content }} {{ block.settings.page.content }}
{%- when 'quantity_selector' -%}
{{ 'products.product.quantity.label' | t }} {{ 'products.product.quantity.decrease' | t: product: product.title | escape }} {% render 'icon-minus' %} {{ 'products.product.quantity.increase' | t: product: product.title | escape }} {% render 'icon-plus' %}
{%- when 'popup' -%} {{ block.settings.text | default: block.settings.page.title }} {{ block.settings.text }} {%- when 'share' -%} {% render 'icon-share' %} {{ block.settings.share_label | escape }}
{% render 'icon-share' %} {{ block.settings.share_label | escape }}
{{ 'general.share.share_url' | t }}
{% render 'icon-close' %} {{ 'general.share.close' | t }} {% render 'icon-clipboard' %} {{ 'general.share.copy_to_clipboard' | t }}
{%- when 'variant_picker' -%} {%- unless product.has_only_default_variant -%} {%- if block.settings.picker_type == 'button' -%} {%- for option in product.options_with_values -%} {{ option.name }} {%- for value in option.values -%} {{ value }} {%- endfor -%} {%- endfor -%} {%- else -%} {%- for option in product.options_with_values -%}
{{ option.name }}
{% render 'icon-caret' %}
{%- endfor -%} {%- endif -%} {%- endunless -%}
{{ 'products.product.product_variants' | t }}
{% render 'icon-caret' %}
{%- when 'buy_buttons' -%}

{%- form ‘product’, product, id: product_form_id, class: ‘form’, novalidate: ‘novalidate’, data-type: ‘add-to-cart-form’ -%}

{%- if product.selected_or_first_available_variant.available -%} {{ 'products.product.add_to_cart' | t }} {%- else -%} {{ 'products.product.sold_out' | t }} {%- endif -%}
{%- if block.settings.show_dynamic_checkout -%} {{ form | payment_button }} {%- endif -%}
{%- endform -%}

{{ ‘component-pickup-availability.css’ | asset_url | stylesheet_tag }}

{%- assign pick_up_availabilities = product.selected_or_first_available_variant.store_availabilities | where: ‘pick_up_enabled’, true -%}

<pickup-availability class=“product__pickup-availabilities no-js-hidden quick-add-hidden”
{% if product.selected_or_first_available_variant.available and pick_up_availabilities.size > 0 %} available{% endif %}
data-root-url=“{{ routes.root_url }}”
data-variant-id=“{{ product.selected_or_first_available_variant.id }}”
data-has-only-default-variant=“{{ product.has_only_default_variant }}”

{% render 'icon-unavailable' %}

{{ 'products.product.pickup_availability.unavailable' | t }}

{{ 'products.product.pickup_availability.refresh' | t }}

{%- when ‘rating’ -%}
{%- if product.metafields.reviews.rating.value != blank -%}
{% liquid
assign rating_decimal = 0
assign decimal = product.metafields.reviews.rating.value.rating | modulo: 1
if decimal >= 0.3 and decimal <= 0.7
assign rating_decimal = 0.5
elsif decimal > 0.7
assign rating_decimal = 1
endif
%}

{{ product.metafields.reviews.rating.value }} / {{ product.metafields.reviews.rating.value.scale_max }}

({{ product.metafields.reviews.rating_count }}) {{ product.metafields.reviews.rating_count }} {{ "accessibility.total_reviews" | t }}

{%- endif -%} {%- endcase -%} {%- endfor -%} {{ 'products.product.view_full_details' | t }} {% render 'icon-arrow' %}
{% render 'icon-close' %}
{%- liquid if product.selected_or_first_available_variant.featured_media != null assign media = product.selected_or_first_available_variant.featured_media render 'product-media', media: media, loop: section.settings.enable_video_looping, variant_image: section.settings.hide_variants endif -%}

{%- for media in product.media -%}
{%- liquid
if section.settings.hide_variants and variant_images contains media.src
assign variant_image = true
else
assign variant_image = false
endif

unless media.id == product.selected_or_first_available_variant.featured_media.id
render ‘product-media’, media: media, loop: section.settings.enable_video_looping, variant_image: variant_image
endunless
-%}
{%- endfor -%}

{% assign popups = section.blocks | where: “type”, “popup” %}
{%- for block in popups -%}
<modal-dialog id=“PopupModal-{{ block.id }}” class=“product-popup-modal” {{ block.shopify_attributes }}>

{% render 'icon-close' %}

{{ block.settings.page.title }}

{{ block.settings.page.content }}
{%- endfor -%}

{%- if product.media.size > 0 -%}

{%- endif -%}

{%- if first_3d_model -%}

{%- endif -%}

{%- liquid
if product.selected_or_first_available_variant.featured_media
assign seo_media = product.selected_or_first_available_variant.featured_media
else
assign seo_media = product.featured_media
endif
-%}

{% schema %} { "name": "t:sections.main-product.name", "tag": "section", "class": "section", "blocks": [ { "type": "@app" }, { "type": "text", "name": "t:sections.main-product.blocks.text.name", "settings": [ { "type": "text", "id": "text", "default": "Text block", "label": "t:sections.main-product.blocks.text.settings.text.label" }, { "type": "select", "id": "text_style", "options": [ { "value": "body", "label": "t:sections.main-product.blocks.text.settings.text_style.options__1.label" }, { "value": "subtitle", "label": "t:sections.main-product.blocks.text.settings.text_style.options__2.label" }, { "value": "uppercase", "label": "t:sections.main-product.blocks.text.settings.text_style.options__3.label" } ], "default": "body", "label": "t:sections.main-product.blocks.text.settings.text_style.label" } ] }, { "type": "title", "name": "t:sections.main-product.blocks.title.name", "limit": 1 }, { "type": "price", "name": "t:sections.main-product.blocks.price.name", "limit": 1 }, { "type": "quantity_selector", "name": "t:sections.main-product.blocks.quantity_selector.name", "limit": 1 }, { "type": "variant_picker", "name": "t:sections.main-product.blocks.variant_picker.name", "limit": 1, "settings": [ { "type": "select", "id": "picker_type", "options": [ { "value": "dropdown", "label": "t:sections.main-product.blocks.variant_picker.settings.picker_type.options__1.label" }, { "value": "button", "label": "t:sections.main-product.blocks.variant_picker.settings.picker_type.options__2.label" } ], "default": "button", "label": "t:sections.main-product.blocks.variant_picker.settings.picker_type.label" } ] }, { "type": "buy_buttons", "name": "t:sections.main-product.blocks.buy_buttons.name", "limit": 1, "settings": [ { "type": "checkbox", "id": "show_dynamic_checkout", "default": true, "label": "t:sections.main-product.blocks.buy_buttons.settings.show_dynamic_checkout.label", "info": "t:sections.main-product.blocks.buy_buttons.settings.show_dynamic_checkout.info" } ] }, { "type": "description", "name": "t:sections.main-product.blocks.description.name", "limit": 1 }, { "type": "share", "name": "t:sections.main-product.blocks.share.name", "limit": 1, "settings": [ { "type": "text", "id": "share_label", "label": "t:sections.main-product.blocks.share.settings.text.label", "default": "Share" }, { "type": "paragraph", "content": "t:sections.main-product.blocks.share.settings.featured_image_info.content" }, { "type": "paragraph", "content": "t:sections.main-product.blocks.share.settings.title_info.content" } ] }, { "type": "custom_liquid", "name": "t:sections.main-product.blocks.custom_liquid.name", "settings": [ { "type": "liquid", "id": "custom_liquid", "label": "t:sections.main-product.blocks.custom_liquid.settings.custom_liquid.label", "info": "t:sections.main-product.blocks.custom_liquid.settings.custom_liquid.info" } ] }, { "type": "collapsible_tab", "name": "t:sections.main-product.blocks.collapsible_tab.name", "settings": [ { "type": "liquid", "id": "heading", "default": "Collapsible row", "info": "t:sections.main-product.blocks.collapsible_tab.settings.heading.info", "label": "t:sections.main-product.blocks.collapsible_tab.settings.heading.label" }, { "type": "select", "id": "icon", "options": [ { "value": "none", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__1.label" }, { "value": "apple", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__2.label" }, { "value": "banana", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__3.label" }, { "value": "bottle", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__4.label" }, { "value": "box", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__5.label" }, { "value": "carrot", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__6.label" }, { "value": "chat_bubble", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__7.label" }, { "value": "check_mark", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__8.label" }, { "value": "clipboard", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__9.label" }, { "value": "dairy", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__10.label" }, { "value": "dairy_free", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__11.label" }, { "value": "dryer", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__12.label" }, { "value": "eye", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__13.label" }, { "value": "fire", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__14.label" }, { "value": "gluten_free", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__15.label" }, { "value": "heart", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__16.label" }, { "value": "iron", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__17.label" }, { "value": "leaf", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__18.label" }, { "value": "leather", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__19.label" }, { "value": "lightning_bolt", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__20.label" }, { "value": "lipstick", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__21.label" }, { "value": "lock", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__22.label" }, { "value": "map_pin", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__23.label" }, { "value": "nut_free", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__24.label" }, { "value": "pants", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__25.label" }, { "value": "paw_print", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__26.label" }, { "value": "pepper", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__27.label" }, { "value": "perfume", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__28.label" }, { "value": "plane", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__29.label" }, { "value": "plant", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__30.label" }, { "value": "price_tag", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__31.label" }, { "value": "question_mark", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__32.label" }, { "value": "recycle", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__33.label" }, { "value": "return", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__34.label" }, { "value": "ruler", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__35.label" }, { "value": "serving_dish", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__36.label" }, { "value": "shirt", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__37.label" }, { "value": "shoe", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__38.label" }, { "value": "silhouette", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__39.label" }, { "value": "snowflake", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__40.label" }, { "value": "star", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__41.label" }, { "value": "stopwatch", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__42.label" }, { "value": "truck", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__43.label" }, { "value": "washing", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.options__44.label" } ], "default": "check_mark", "label": "t:sections.main-product.blocks.collapsible_tab.settings.icon.label" }, { "type": "liquid", "id": "content", "label": "t:sections.main-product.blocks.collapsible_tab.settings.content.label" }, { "type": "page", "id": "page", "label": "t:sections.main-product.blocks.collapsible_tab.settings.page.label" } ] }, { "type": "popup", "name": "t:sections.main-product.blocks.popup.name", "settings": [ { "type": "text", "id": "text", "default": "Pop-up link text", "label": "t:sections.main-product.blocks.popup.settings.link_label.label" }, { "id": "page", "type": "page", "label": "t:sections.main-product.blocks.popup.settings.page.label" } ] }, { "type": "rating", "name": "t:sections.main-product.blocks.rating.name", "limit": 1, "settings": [ { "type": "paragraph", "content": "t:sections.main-product.blocks.rating.settings.paragraph.content" } ] } ], "settings": [ { "type": "checkbox", "id": "enable_sticky_info", "default": true, "label": "t:sections.main-product.settings.enable_sticky_info.label" }, { "type": "header", "content": "t:sections.main-product.settings.header.content", "info": "t:sections.main-product.settings.header.info" }, { "type": "select", "id": "gallery_layout", "options": [ { "value": "stacked", "label": "t:sections.main-product.settings.gallery_layout.options__1.label" }, { "value": "thumbnail", "label": "t:sections.main-product.settings.gallery_layout.options__2.label" }, { "value": "thumbnail_slider", "label": "t:sections.main-product.settings.gallery_layout.options__3.label" } ], "default": "stacked", "label": "t:sections.main-product.settings.gallery_layout.label" }, { "type": "select", "id": "media_size", "options": [ { "value": "small", "label": "t:sections.main-product.settings.media_size.options__1.label" }, { "value": "medium", "label": "t:sections.main-product.settings.media_size.options__2.label" }, { "value": "large", "label": "t:sections.main-product.settings.media_size.options__3.label" } ], "default": "large", "label": "t:sections.main-product.settings.media_size.label", "info": "t:sections.main-product.settings.media_size.info" }, { "type": "select", "id": "mobile_thumbnails", "options": [ { "value": "show", "label": "t:sections.main-product.settings.mobile_thumbnails.options__1.label" }, { "value": "hide", "label": "t:sections.main-product.settings.mobile_thumbnails.options__2.label" } ], "default": "hide", "label": "t:sections.main-product.settings.mobile_thumbnails.label" }, { "type": "checkbox", "id": "hide_variants", "default": false, "label": "t:sections.main-product.settings.hide_variants.label" }, { "type": "checkbox", "id": "enable_video_looping", "default": false, "label": "t:sections.main-product.settings.enable_video_looping.label" }, { "type": "header", "content": "t:sections.all.padding.section_padding_heading" }, { "type": "range", "id": "padding_top", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "t:sections.all.padding.padding_top", "default": 36 }, { "type": "range", "id": "padding_bottom", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "t:sections.all.padding.padding_bottom", "default": 36 } ] } {% endschema %}