Navigation überspringen

[Gelöst] Adding headers/titles to table of results

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
How to add headers to table generated using views

Solution:
you should add your header code outside the tag and it will not repeat the headers and you will see header only once.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/adding-headers-titles-to-table-of-results/#post-777899

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

This support ticket is created vor 6 Jahren, 8 Monaten. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von leilaG vor 6 Jahren, 8 Monaten.

Assistiert von: Minesh.

Author
Artikel
#777435

We would like to add header/titles to the results of this page - versteckter Link

Example:

Job Title Location Category

When we add the code in views, it repeats on every row of results, what's the best way to do this?

#777899

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - its simple, you should add your header code outside the <loop> tag and it will not repeat the headers and you will see header only once.

For example:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<table width="100%">
		<thead>
			<tr>
				<th>Job Title</th>
                                <th>Location</th>
                                <th>Category</th>
		</tr>
		</thead>
		<tbody class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<tr>
				<td> field1 </td>
				<td>ield2 </td>
				<td>ield3</td>
			</tr>
		</wpv-loop>
		</tbody>
	</table>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

More info:
=> https://toolset.com/documentation/user-guides/view-layouts-101/#table

#779092

Perfect! Thank you