Assuming that you want a rational approximation of $\tan(x)$ for the range $$(2n-1)\frac \pi 2 \leq x \leq (2n+1)\frac \pi 2$$ you could notice that the function
$$g(x)=\Big[x-(2n-1)\frac \pi 2\Big]\Big[(2n+1)\frac \pi 2-x\Big]\tan(x)$$ is quite nice since the left and right asymptotes have been removed.
Now, we can build around $x=n \pi$ the Padé approximant of $g(x)$. Using the simple $[3,2]$ would give
$$\tan(x)\sim h(x)=\frac{3(n\pi-x)\Big[ \alpha +\beta (x-n\pi)^2\Big] }{\Big[x-(2n-1)\frac \pi 2\Big]\Big[(2n+1)\frac \pi 2-x\Big]\Big[\gamma+\delta (x-n\pi)^2 \Big]}$$ with
$$\alpha=15 \pi ^2 \left(12-\pi ^2\right)\qquad \qquad \beta=-720+60 \pi ^2+\pi ^4$$
$$\gamma=-180 \left(12-\pi ^2\right)\qquad \qquad \delta=72 \left(10-\pi ^2\right)$$
For illustration, using $\epsilon=\frac \pi{100}$
$$\int_{0}^{\frac \pi 2-\epsilon} \Big[h(x)-\tan(x)\Big]^2\,dx=5.49\times 10^{-6}$$ corresponding to a relative error of $0.025$%.

Fig. 1: Representation of the difference $y=h(x)-\tan(x)$ for $n=2$ showing that in the two-thirds of interval $(\frac32 \pi,\frac52 \pi)$, the absolute value of this difference is less than $10^{-5}$.
We can do much better.
Edit
If we use the next approximation of $g(x)$, that is to say its $[5,4]$ Padé approximant, we have
$$g(x)= -\frac{\pi^2}4(n\pi-x)\frac {1+a_1(n\pi-x)^2+a_2(n\pi-x)^4 } {1+b_1(n\pi-x)^2+b_2(n\pi-x)^4 }$$ with
$$a_1=-\frac{60480-5040 \pi ^2-120 \pi ^4+\pi ^6}{9 \pi ^2 \left(1680-180 \pi ^2+\pi^4\right)}\qquad \qquad a_2=\frac{604800-65520 \pi ^2+420 \pi ^4+\pi ^6}{945 \pi ^2 \left(1680-180 \pi ^2+\pi^4\right)}$$
$$b_1=-\frac{4 \left(1620-174 \pi ^2+\pi ^4\right)}{9 \left(1680-180 \pi ^2+\pi
^4\right)}\qquad \qquad b_2=\frac{1008-112 \pi ^2+\pi ^4}{63 \left(1680-180 \pi ^2+\pi ^4\right)}$$
For this case
$$\int_{0}^{\frac \pi 2-\epsilon} \Big[h(x)-\tan(x)\Big]^2\,dx=8.36\times 10^{-12}$$
The plot @Jean Marie kindly added would show that, in the two-thirds of interval $(\frac32 \pi,\frac52 \pi)$, the absolute value of the difference is less than $10^{-8}$.