Skip Navigation

[Resolved] Add more columns to a table grid

This thread is resolved. Here is a description of the problem and solution.

Problem:
How can I add more columns to a Table Grid?

Solution:
You can either user the Loop Wizard to create a Table Grid with as many columns as you want, or you can edit the HTML in the Loop generated by the Loop Wizard.

<tr>
  <td></td>
//Add more <td></td> to add more columns
</tr>

Relevant Documentation:
https://toolset.com/documentation/user-guides/view-layouts-101/

This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by kelvinL-2 7 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#398487
Screen Shot 2016-05-16 at 2.16.58 AM.png
Screen Shot 2016-05-16 at 2.16.48 AM.png

Dear Beda,

How can I fix the number of column in Table-based grid? I set the number of column as 4 and apply the Table-based grid in horizontal slider, each slider contain 4 post, if I have 5 video post to be showed, the first slider show the first 4 grid at evenly width, but when I click next to view the second page, the 5th video is showed full width across all 4 grids.

You can visit this hidden link and click the next or see my attached screenshot.

I want to keep 4 girds no matter how many post I have, if only one post to be viewed, keep 1 grid with content and 3 grids with empty content.

I manually hardcode the td with style="width: 25%" to fix the width of each td element. Is there any alternative solution suggested from Toolset?

	<!-- wpv-loop-start -->
	<table width="100%" class="wpv-loop js-wpv-loop">
	<wpv-loop wrap="4" pad="true">
		[wpv-item index=1]
		<tr>
			<td style="width: 25%">
				[wpv-post-body view_template="Program Chapter List Slider - slide"]&nbsp;
			</td>
		[wpv-item index=other]
			<td style="width: 25%">
				[wpv-post-body view_template="Program Chapter List Slider - slide"]&nbsp;
			</td style="width: 25%">
		[wpv-item index=4]
			<td style="width: 25%">
				[wpv-post-body view_template="Program Chapter List Slider - slide"]&nbsp;
			</td>
		</tr>
		[wpv-item index=pad]
			<td style="width: 25%">&nbsp;</td>
		[wpv-item index=pad-last]
			<td style="width: 25%">&nbsp;</td>
		</tr>
	</wpv-loop>
#398601

As you can see in my ScreenShot, the empty Grid Tables are there.

You can insert a Image, Placeholders or whatsoever in your Pad and Pad last section of HTML

Currently you insert No Breaking Spaces, and I would not use this for this purpose:
hidden link

Let me know if I misunderstood the issue

#398611

Dear Beda,

Sorry there is no screenshot from you. I find it is not necessary to add the non-breaking-space but must to set the style="width: 25%", is it the normal practices?

Best regards,

Kelvin.

#398612
Bildschirmfoto 2016-05-16 um 16.22.32.png

I'm sorry, here we go with the screenshot.

If you fix the grid with 25% it means the GRID always will be that width, otherwise it will responsively adapt to your content.

Thanks

#398626
Untitled-1.jpg

Dear Beda,

Ok, seem adding the width style is to fix the number of grid.

While we selecting the Table-based grid, it may be a bit misleading to the Number of columns, I assume this is the expected layout no matter how many post we have, of course the grid is responsively adapt the content but keeping the number of column.

I would suggest changing the title as "Max. number of columns" or adding an option "Fixed Grid Width" in the setting (see screenshot), if enable "Fixed Grid Width" always show number of column and using the solution I provided, otherwise contest is responsively adapt.

You can closed this ticket if you read this. Thanks a lot.

Best regards,

Kelvin.

#398650

This is not used to define the number off columns, but there width.

If you have wide content, those might get adjusted, but still you would have 4 columns.

If you fix their Width, those will display no matter the width of your content, with the give with.

The amount of columns in the table are defined via HTML by:

<tr>
  <td></td>
//Add more <td></td> to add more columns
</tr>

Since your content is empty, you don't insert any placeholders, and the Video obviously is wider natively, it stretches over the empty cells.
If you would add placeholders, those would "hold the place" and the last item (the video) would not stretch.

I hope we did not misunderstand each other 🙂

#398688

Dear Beda,

Thanks for you clarification.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.