Align Decimal Data in table column by decimal point, HTML5, CSS3

前端 未结 7 1863
有刺的猬
有刺的猬 2020-12-17 21:58

I am building a wordpress plugin which is generating an HTML table and sending to gravityforms html block via shortcode.

My problem is that cell contents can contain

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-17 22:30

    I wrote a jQuery plugin that solves this. It's found here: https://github.com/ndp/align-column

    Using your raw HTML table, it will align a column by decimal points:

    $('table').alignColumn(3);

    It does this by adding another column, but does its best to not corrupt the other spacing. There's also a reference to a different solution on the Github page.

提交回复
热议问题