• Resolved esd3104

    (@esd3104)


    The above is one example of a single doc page where I have used tables for some information. On larger screens this works fine but on phones and other smaller screen devices there seems to be a problem.

    On the smaller screens in horizontal mode the columns going to the right are simply cut off. You cannot see or get to the rest of the table data. You can see it when you flip the phone to landscape orientation.

    I did try to change the table from one created with the Block Editor to one created with the Tablepress plugin with the additional Responsive extension. This also only partially worked as in “scroll” or “flip” mode you still couldn’t get to all the table data. I’ve used this Tablepress with responsive on other sites with the same theme. For example: https://allbritishcarshow.com/prior-years/2022-show/#results

    Since even Tablepress in responsive mode doesn’t work I’m kinda stumped. I have removed the Tablepress option since it didn’t work and left just the block editor tables.

    Any suggestions on how to get all the table data accessible on smaller screen devices?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello there,

    I hope you are doing well.

    I have checked your website and It seems an scrollbar is now enabled on your website. If you want to make it more responsive, you can use this Custom CSS given below. Please check this screencast to see how it looks like after adding this CSS.

    @media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px)  {
    	.docs-single-main .wp-block-table table, thead, tbody, th, td, tr {
    		display: block;
            text-align: right!important;
    	}
        
    	.docs-single-main .wp-block-table thead tr {
    		position: absolute;
    		top: -9999px;
    		left: -9999px;
    	}
    
        .docs-single-main .wp-block-table tr {
            margin: 0 0 1rem 0;
        }
          
        .docs-single-main .wp-block-table tr:nth-child(odd) {
            background: #ccc;
        }
        
    	.docs-single-main .wp-block-table td {
    		border: none;
    		border-bottom: 1px solid #eee;
    		position: relative;
    		padding-left: 50%;
    	}
    
    	.docs-single-main .wp-block-table td:before {
    		position: absolute;
    		top: 20px;
        	left: 10px;
    		padding-right: 10px;
    		white-space: nowrap;
            text-align: left
    	}
    
    	.docs-single-main .wp-block-table td:nth-of-type(1):before { content: "TSB Number"; }
    	.docs-single-main .wp-block-table td:nth-of-type(2):before { content: "Subject"; }
    	.docs-single-main .wp-block-table td:nth-of-type(3):before { content: "Date"; }
    	.docs-single-main .wp-block-table td:nth-of-type(4):before { content: "View/Download"; }
    	.docs-single-main .wp-block-table td:nth-of-type(5):before { content: "Applies To"; }
    }

    You can simply add custom CSS by navigating to your WordPress Dashboard -> Appearance -> Customize.


    After you are on the Customizer page, search for the “Additional CSS” option.

    You can then go ahead and insert the CSS Code. Please check this screencast to learn more – https://d.pr/v/QrrfTw

    Let me know how it goes. Thank you!

    Thread Starter esd3104

    (@esd3104)

    Thanks. I actually got it to work by changing the single doc page layout in Customiser from the first one to the second one. Not quite sure what all the differences in the layout options do but the 2nd one added the scroll bar for the tables.

    I will look at the info you have shared and play around with the extra CSS to see if that makes it even better. Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Tables On Sing Doc Page – Not Responsive’ is closed to new replies.