JavaScript How to draw a square using Javascript inside an element? draw square using css,draw square using dda algorithm,draw

I have done a lot of research and am not sure what the best approach is. I have a Kendo Grid (table) with 3 rows and 3 columns. I show a table with only the first column populated upon initial page load, and then I call and AJAX method to retrieve the rest of the data and replace the whole table with the new HTML.

----------------
| 01 |    |    |
| 02 |    |    |
| 03 |    |    |
----------------

And I replace the whole table with html that shows a table like this:

----------------
| 01 | hi | gr |
| 02 | hi | sd |
| 03 | fe | sf |
----------------

What I want to do though, is somehow "draw" a square over the empty columns in the initial empty table (with only the first column populated) so I can display a message in the center.

What is the best approach to achieve this?

Answer:1

Here is an example what are you looking for. There is 2 px error because of the cells border spacing or something but i'm too tired to find the solution for that now. Your div's height is equals with padding-top+height. Padding is needed to position your loading text vertically middle.

<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        #mytable{
            position: absolute;
            border: 1px solid black;
            width: 20%;
            width: 100px;
            height: 100px;

}
        #box{
            padding-top: 40px;
            text-align: center;
            position: absolute;
            margin: 0px;
            z-index: 40;
            border: 1px solid blue;
            width: 100px;
            height: 60px;
        }

    </style>
</head>
<body>
    <table id="mytable">
        <tr>
            <td>Cat</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>Dog</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>Parrot</td>
            <td></td>
            <td></td>
        </tr>
    </table>
    <div id="box">
        Loading...
    </div>
</body>
</html>
Answer:2

I am attempting to run a paired t-test in bigquery using the JavaScript statistical.js library and I am getting inconsistent numbers. My code is as follows; CREATE TEMPORARY FUNCTION ttest(a ARRAY&...

I am attempting to run a paired t-test in bigquery using the JavaScript statistical.js library and I am getting inconsistent numbers. My code is as follows; CREATE TEMPORARY FUNCTION ttest(a ARRAY&...

When adding elements via pure js on Vue Single File Component, the added elements don't have v-id-xx attribute for scoped css. How can I get THE component's v-id-hash value by pure js?

When adding elements via pure js on Vue Single File Component, the added elements don't have v-id-xx attribute for scoped css. How can I get THE component's v-id-hash value by pure js?

How to access a nested property, in a safe way (i.e. without throwing a TypeError) (a.b) ? a.b.c : undefined Is there a less verbose way, without using a framework ?

How to access a nested property, in a safe way (i.e. without throwing a TypeError) (a.b) ? a.b.c : undefined Is there a less verbose way, without using a framework ?

  1. access nested property javascript
  2. javascript access nested property by string
  3. access nested object property javascript
  4. js access nested property by string
  5. lodash access nested property
  6. es6 access nested property
  7. javascript access nested property dynamically
  8. typescript access nested property
  9. access nested json property javascript
  10. access nested json property
  11. js access nested property
  12. access nested object property js
  13. javascript safely access nested property
  14. javascript access nested object property with variable
  15. js access nested object property by string
  16. javascript access object nested property by string
  17. typescript access nested object property
  18. javascript access nested object property dynamically
  19. c# access nested class property
  20. php access nested object property

I have similar code like below and I want If I clicked in Child Div then Parent Div click event should not trigger. <div class="parentDiv" (click)="parentDiv()"> <div class="childDiv" (...

I have similar code like below and I want If I clicked in Child Div then Parent Div click event should not trigger. <div class="parentDiv" (click)="parentDiv()"> <div class="childDiv" (...