在批处理内内嵌:- :Tab <Width> <Height> <Width[Cell]> <Height[Cell]>
- Rem Width - 以单元格为单位,绘制表格的宽
- Rem Height - 以单元格为单位,绘制表格的高
- Rem Width[Cell] - 单元格的宽
- Rem Height[Cell] - 单元格的高
- for /l %%i in (1,1,%2) do (
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- Echo.
- for /l %%x in (1,1,%4) do (
- Set /p Str=^|<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=# <nul
- )
- Set /p Str=^|<nul
- )
- Echo.
- )
- )
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- @Goto :Eof
复制代码 外部函数形式:
Tab.Bat- @Echo Off
- @Goto :Tab
- :Tab <Width> <Height> <Width[Cell]> <Height[Cell]>
- Rem Width - 以单元格为单位,绘制表格的宽
- Rem Height - 以单元格为单位,绘制表格的高
- Rem Width[Cell] - 单元格的宽
- Rem Height[Cell] - 单元格的高
- for /l %%i in (1,1,%2) do (
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- Echo.
- for /l %%x in (1,1,%4) do (
- Set /p Str=^|<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=# <nul
- )
- Set /p Str=^|<nul
- )
- Echo.
- )
- )
- Set /p Str=+<nul
- for /l %%j in (1,1,%1) do (
- for /l %%x in (1,1,%3) do (
- Set /p Str=-<nul
- )
- Set /p Str=+<nul
- )
- @Exit /b
复制代码 By Hope2021
谢谢 |