Ergebnis 1 bis 4 von 4

Thema: Template für Mobile-Tabelle?

  1. #1
    Contao-Nutzer
    Registriert seit
    03.01.2011.
    Beiträge
    97

    Standard Template für Mobile-Tabelle?

    Hi Leute,

    hat zufällig jemand ein passendes Template / CSS für die Ausgabe von Datensätzen in einer mobile responsive Tabelle?

    Aktuell sieht es bei mir so aus:

    Code:
    <?php $this->extend($this->searchable ? 'block_searchable' : 'block_unsearchable'); ?>
    
    <?php $this->block('content'); ?>
    <div class="labels">
    	<div class="columnHead">
    		<div class="headTag">Tag</div>
    		<div class="headEinstieg">Einstieg möglich am</div>
    		<div class="headUhrzeit">Uhrzeit</div>
    		<div class="headAnmeldung clearfix">Anmeldung</div>
    	</div>
    </div>
    <?= $this->items ?>
    <?= $this->pagination ?>
    <?php $this->endblock(); ?>
    PHP-Code:
    <?php if (count($this->data)): ?> 

    <div class="layout_full"> 

    <?php foreach ($this->data as $arrItem): ?> 
    <?php $this->block('item'); ?> 
    <div class="item <?= $arrItem['class'?>"> 

    <?php foreach ($arrItem['attributes'] as $field => $strName): ?> 
    <?php if ((isset($arrItem[$this->getFormat()][$field]) && ($strValue $arrItem[$this->getFormat()][$field]) 
        || (isset(
    $arrItem['text'][$field]) && ($strValue $arrItem['text'][$field])))): ?> 
    <div class="field <?= $field ?>"> 
    <?php if (!$this->view->get('hideLabels')): ?> 
    <div class="label"><?= sprintf($GLOBALS['TL_LANG']['MSC']['field_label'], $strName?></div> 
    <?php endif; ?> 
    <div class="value"> <?= $strValue ?></div> 
    </div> 
    <?php endif; ?> 
    <?php endforeach; ?> 

    <div class="field url"><a href="{{link_url::16}}?kurs=<?= $arrItem['raw']['kurs'?>">Anmelden</a></div>

    <?php $this->block('actions'); ?> 
    <div class="actions"> 
    <?php foreach($arrItem['actions'] as $action): ?> 
    <?php $this->insert('mm_actionbutton', ['action' => $action]); ?> 
    <?php endforeach; ?> 
    </div> 
    <?php $this->endblock(); ?> 
    </div> 
    <?php $this->endblock(); ?> 
    <?php endforeach; ?> 
    </div> 
    <?php else : ?> 
    <?php $this->block('noItem'); ?> 
    <p class="info"><?= $this->noItemsMsg ?></p> 
    <?php $this->endblock(); ?> 
    <?php endif; ?>
    Das wäre super

    Viele Grüße
    Geändert von danielx11 (24.01.2018 um 12:37 Uhr)

  2. #2

  3. #3
    Contao-Nutzer
    Registriert seit
    03.01.2011.
    Beiträge
    97

    Standard

    Hat sich erledigt:

    Code:
    <?php if (count($this->data)): /* display only if there is data. */ ?>
    <?php $arrItem = $this->data[0]; /* fetch first item for title columns. */ ?>
     
    <div style="overflow-x:auto;">
    <table class="termintabelle">
      <thead>
          <tr>
    	<th><?php echo $arrItem['attributes']['title']; ?></th>
    	<th><?php echo $arrItem['attributes']['startdatum']; ?></th>
    	<th><?php echo $arrItem['attributes']['enddatum']; ?></th>
    	<th><?php echo $arrItem['attributes']['meldeschluss']; ?></th>
    	<th><?php echo $arrItem['attributes']['ort']; ?></th>
    	<th><?php echo $arrItem['attributes']['kontaktperson']; ?></th>
    	<th><?php echo $arrItem['attributes']['email']; ?></th>
          </tr>
      </thead>
     
      <tbody>
      <?php?>
      <?php foreach ($this->data as $arrItem): /* loop over all items. */ ?>
     
        <tr>
    	<td><?php echo $arrItem['text']['title']; ?></td>
    	<td><?php echo $arrItem['text']['startdatum']; ?></td>
    	<td><?php echo $arrItem['text']['enddatum']; ?></td>
    	<td><?php echo $arrItem['text']['meldeschluss']; ?></td>
            <td><?php echo $arrItem['text']['ort']; ?></td>
            <td><?php echo $arrItem['text']['kontaktperson']; ?></td>
            <td><a href="mailto:<?php echo $arrItem['text']['email']; ?>"><?php echo $arrItem['text']['email']; ?></a></td>
        </tr>
     
      <?php endforeach; /* item loop */ ?>
      </tbody>
    </table>
    </div> 
    <?php endif; ?>
    Und die Tabelle auf 100% gesetzt.

  4. #4

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •