In the code below, I was able to produce dashed grey vertical lines of a certain width. I want to replace the solid line by a dashed one. I tried to add : using the arydshln package, but it leads to error.
\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tabularx}
\usepackage{lscape}
\usepackage{geometry}
\usepackage{colortbl}
\usepackage{tcolorbox}
\geometry{left=2mm,right=2mm}
\geometry{top=3mm,bottom=3mm}
\newcolumntype{?}{!{\color{gray}\vrule width 0.5pt}}
\begin{document}
\begin{table}
\caption{Caption}
\begin{tabularx}{0.4\textwidth}{>{\hsize=\hsize}X?>{\hsize=\hsize}X}
\hline\[0.2pt]
A & B\
D & E\
\end{tabularx}
\label{table1}
\end{table}
\end{document}


nicematrixpackage since it combines withtikz-- have a look at the answer below – js bibra Dec 10 '20 at 01:29