Table is not responsive

Created on 2 December 2024, 16 days ago

Table overflows to the right.

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Ricmayak1
  • 🇪🇨Ecuador jwilson3

    Needs more clarification. Where or how you were creating tables that broke? Please add screenshots and ideally a code snippet of a broken table. I'm just trying to clarify whether this is an issue we should solve in this theme, or whether this needs to be filed in the upstream repository: https://github.com/indiana-university/rivet-source

    Thanks.

  • The code below was added to make every views table to be mobile responsive. I suggest that it should be added to the theme's css.

    /* Make the table container scrollable */
    .views-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    }

    /* Ensure table content wraps properly */
    .views-table td,
    .views-table th {
    word-wrap: break-word;
    white-space: normal;
    }

    /* Add responsiveness for smaller screens */
    @media (max-width: 768px) {
    .views-table th, .views-table td {
    padding: 8px;
    font-size: 14px;
    }

    .views-table {
    width: 100%;
    }
    }

  • 🇪🇨Ecuador jwilson3

    Sorry, I'm not going to add that CSS without the additional context I asked for, including screenshots. If this is related to views, I need a list of steps to duplicate the bug, including steps on how to create a view that exhibits problems.

    You're free to subtheme the Rivet theme and add any custom CSS you need, as this methodology is exactly how Drupal base themes are intended to be used.

  • 🇪🇨Ecuador jwilson3

    Rivet table styles are responsive out of the box in my testing.

    https://rivet.iu.edu/components/table/

    https://codepen.io/jameswilson/pen/bNbgGgY

Production build 0.71.5 2024