You must Sign In to post a response.
  • Category: JQuery

    Det height of td using jquery

    Hi,

    I want to change the the height of td in an html table by jquery

    i tried this

    $('#table tr td').css('height', '10px');

    but not working

    How to solve this

    Regards

    Baiju
  • #763579
    Hi baiju

    You can use the following code to change property of td which is inside a table.

    <script>

    $(document).ready(function () {
    $("table td").attr("height", "20px");
    });

    </script>

    Sridhar Thota.
    Editor: DNS Forum.

  • #763580
    If you want to change the height of the table column you can use simple style right?

    <style>
    table{
    height:500px;
    }
    table td{
    height:10px;
    }
    </style>

    By Nathan
    Direction is important than speed

  • #763585
    just try below JQuery snippet, following code will change the height of the td table height within #table1 table
    // eq() is zero-based.

    $('#table1 td').eq(1).css('height', '200px');

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


Sign In to post your comments