Looking to create a unique custom drop-down autocomplete suggestion list using HTML and CSS, similar to Chrome's design (shown below).
https://i.sstatic.net/Kia2N.png
In my attempts to achieve this, I utilized an absolutely positioned table beneath the input element. I applied vertical-align: middle;
to the td
elements and text-align: right;
exclusively to the second td
element. Everything appeared fine until I set a min-width
for the table to match the input's width. This caused extra space on the right of the second td
. I experimented with floating and absolute positioning for the second td
, but encountered issues such as loss of vertical-align: middle;
functionality and overlapping td
elements.
Seeking a solution that mirrors Chrome's look and functionality without resorting to JavaScript-based dynamic styling or hard-coding specific dimensions for elements to maintain flexibility in styling options.