Return the table layout: - Javascript CSS Style Property

Javascript examples for CSS Style Property:tableLayout

Description

Return the table layout:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
table, td {
    border: 1px solid black;
}

#myTABLE {//from   w ww. j  av a  2 s.  co m
    width: 100%;
}
</style>
</head>
<body>

<table id="myTABLE" style="table-layout:fixed;">
  <tr>
    <td>1000000000000000000000000000</td>
    <td>10000000</td>
  </tr>
  <tr>
    <td>J</td>
    <td>S</td>
  </tr>
  <tr>
    <td>J</td>
    <td>D</td>
  </tr>
</table>
<br>

<button type="button" onclick="myFunction()">Return table layout</button>

<script>
function myFunction() {
    console.log(document.getElementById("myTABLE").style.tableLayout);
}
</script>

</body>
</html>

Related Tutorials