Get redirected to a div automatically without user's intervention
I am not going to search the code for you. But most sites tell you you need an onclick event because that is needed to open a link. And example.com#idOfDiv, is the kind of link you would open. Howerver, there is another possibility.
Find some javascript code to decide the position of an element in x and y coordinats. After you got it, make JS Scroll ;).
I am new to JavaScript.

The problem goes as follows: I have 10 div in my html file. I  am using links to go from one to another. Now, I want to test a condition which if satisfied (I am using python for this), should redirect me to another div within the same html. But I want that to be automatic. For eg, I am in <div id="table1"> and inside it I am checking a condition. If that is true, I should be redirected automatically to <div id="table3">.Can anyone please help me find the way out?On google,when I am trying to search for it, it is giving me results where I have to click a button for redirection (which will invoke a JS function). But I don't want that. I want it to happen automatically. So, please tell. 

<div id="table5">
    <div  style="position:fixed;right:40px;top:65px;">
        <a name="t10" href="#t10" onclick='show(10);'><button>  GO TO MAIN PAGE  </button></a>
    </div>
    % if not obj.i:
        <h2>REDIRECT ME TO id="table3"</h2>
    % else:
        <table border=1 cellpadding=7>
            <tr>
                <th>Row No. in Sheet</th>
                <th>Parameters</th>
            </tr>
            <tr>
                <th colspan=2>Total : ${value}</th>
            </tr>
        </table>
    % endif
</div>