A
A
Andrey Dontsov2020-05-19 22:59:07
css
Andrey Dontsov, 2020-05-19 22:59:07

How to make an input in a table the width of its content?

Greetings.
How to lay out a text input in a table so that it is the width of its content (value)?
Without hardcode size in width! Those. the width should be dynamic, according to the length of the text.
Here is a link to the fiddle

sandbox. By default, input looks like this (only part of the text is displayed):
5ec4387e09602978640000.png

It needs to be like this:
5ec4389dc87d3648315174.png

Once again, I draw your attention, the input is not 100% wide, but exactly the length of the text content without manually setting the size.

Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question