Sha256: e8e4a8aa28ce4c6b47dc86a86d5ff873742c7b495b32e1d0ad8c80ebaeeb388e

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

$(function() {
    $('.horizontal-scroll > table').each(function() {
        // Get cell width from longest line in table
        let cellWidth = $(this)
            .find('th,td')
            .map(function() { return parseInt($(this).outerWidth()) })
            .get()
            .reduce((a, b) => Math.max(a, b))
        console.log('Table Cell Width:', cellWidth)

        // Set minimum width of table cell to width of longest element
        $(this).find('th,td').css('min-width', cellWidth)
    })
})

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-theme-peaceful-gates-1.2.0 assets/js/table-layout.js
jekyll-theme-peaceful-gates-1.1.0 assets/js/table-layout.js