Table td width.. in diffrent tr I'm trying to set td width to diffrent px on each row.
So i generate a table tag with HTML.
Then i loop out a table with PHP.
If i put all td´s in one tr it works, but i got all td on same row.
I'd like to have just one td on each tr.
What i'm doing is building rectangles with diffrent length in a list.
Later on, they will be draggable.
Code
echo "<tr><td class='tdElements' id='".$row['id']."' style='width:".$row['element_langd']."px' draggable='true' ondragstart='drag(event)'>".$row['element_langd']."</td></tr>";


Try:
echo 
     "<div id='".$row['id']."' style='width:".$row['element_langd']."px'
       draggable='true' ondragstart='drag(event)'>"
       .$row['element_langd'].
      "</div>";

You can explicitly define the width of an individual <div> using css and, so each rectangle should be sized according to the $row['element_langd'] value.